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 670433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:15:43+00:00 2026-05-14T00:15:43+00:00

the second function gives error C2803 http://msdn.microsoft.com/en-us/library/zy7kx46x%28VS.80%29.aspx : ‘operator ,’ must have at least

  • 0

the second function gives error C2803 http://msdn.microsoft.com/en-us/library/zy7kx46x%28VS.80%29.aspx : ‘operator ,’ must have at least one formal parameter of class type. any clue?

template<class T,class A = std::allocator<T>> 
class Sequence : public std::vector<T,A> {
 public:
    Sequence<T,A>& operator,(const T& a) {
        this->push_back(a);
        return *this;
    }
    Sequence<T,A>& operator,(const Sequence<T,A>& a) {
        for(Sequence<T,A>::size_type i=0 ; i<a.size() ; i++) {
            this->push_back(a.at(i));
        }
        return *this;
    }
};

//this works!
template<typename T> 
Sequence<T> operator,(const T& a, const T&b) {
    Sequence<T> seq;
    seq.push_back(a);
    seq.push_back(b);
    return seq;
}

//this gives error C2803!
Sequence<double> operator,(const double& a, const double& b) {
    Sequence<double> seq;
    seq.push_back(a);
    seq.push_back(b);
    return seq;
}
  • 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-05-14T00:15:43+00:00Added an answer on May 14, 2026 at 12:15 am

    Change that to:

    Sequence<double> operator,(const Sequence<double>& a, const double& b)
    {
        Sequence<double> seq(a);
        seq.push_back(b);
        return seq;
    }
    

    or (based on this article):

    Sequence<double> operator,(Sequence<double> seq, const double& b)
    {
        seq.push_back(b);
        return seq;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm programming an iPhone app using Objective-C. Here's the error Xcode gives me: error:
I have a ColdFusion function foo which takes three args, and the second two
I want to repeatedly execute a function in Python every 60 seconds forever (just
I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript.
The second question is: When do I use what of these two?
The second part of that question is key. If you are one of a
This most be the second most simple rollover effect, still I don't find any
I'm the second dev and a recent hire here at a PHP/MySQL shop. I
Sorry for the second newbie question, I'm a developer not a sysadmin so this
I've seen second one in another's code and I suppose this length comparison have

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.