Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:39:31+00:00 2026-06-07T05:39:31+00:00

I have implemented a value structure in C++/CX. For initializing a vector of the

  • 0

I have implemented a value structure in C++/CX. For initializing a vector of the structure I need to implement an Equality operator which is necessary in the IndexOf() operator of a vector as present in Collection.h.

But I am unable to create one.Can some one help me with it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:39:32+00:00Added an answer on June 7, 2026 at 5:39 am

    Here’s an example:

    struct typePerson {
      string firstName;
      string lastName;
    
      typePerson(string firstName,string lastName) : firstName(firstName), lastName(lastName) {}  
    
      bool operator==(const typePerson& p2) const {
        const typePerson& p1=(*this);
        return p1.firstName == p2.firstName && p1.lastName == p2.lastName;
      }
    };
    

    Sample Usage:

    int main() {
      typePerson p1("John","Doe");
      typePerson p2("Jane","Doe");
      typePerson p3("John","Doe");
    
      if (p1 == p2)
        cout<<"p1 equals p2"<<endl;
      else
        cout<<"p1 does not equal p2"<<endl;
    
      if (p1 == p3)
        cout<<"p1 equals p3"<<endl;
      else
        cout<<"p1 does not equal p3"<<endl;
    
    
      return 0;
    }
    
    ---------- Capture Output ----------
    p1 does not equal p2
    p1 equals p3
    
    > Terminated with exit code 0.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data structure of key value pairs and I want to implement
I have a need to set a collection of name/value pairs inside my application
How can I implement STL map sorting by value? For example, I have a
I have a structure which I create a custom constructor to initialize the members
I have a lot of text data with different structure. I need to extract
Is it possible to implement associative arrays as Selectors and Values. I have an
I have implemented correctly bump's api, and added this code: - (void) configureBump {
I have implemented pagination to my data, but the problem is I only have
I have implemented a table view with multiple threads. Currently when a user taps
I have implemented a test method with Jersey to run on my Google AppEngine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.