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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:22:42+00:00 2026-05-27T08:22:42+00:00

While attempting to provide an implimentation to this question , I got stuck on

  • 0

While attempting to provide an implimentation to this question, I got stuck on an error. I’m getting errors for 8 of my functions like this:

f:\code\utilities\hypergraph\hypergraph\hypergraph.h(233): error C2244: ‘hypergraph::add_edge’ : unable to match function definition to an existing declaration
f:\code\utilities\hypergraph\hypergraph\hypergraph.h(68) : see declaration of ‘hypergraph::add_edge’
definition
‘hypergraph::node_iter hypergraph::add_edge(void)’
existing declarations
‘std::set::node*,ptr_cmp::node,P>,A>::const_iterator hypergraph::add_edge(void)’

for this class:

template<class T, class P>
struct ptr_cmp 
    : public std::binary_function<T, T, bool> {
    P p_;
    ptr_cmp(P p=P()) :p_(p) {}
    bool operator()(const T* l, const T* r) const
    { return p_(*l, *r);}
};

template<class T, class P = std::less<T>, class A=std::allocator<T> >
class hypergraph {
    typedef A sub_allocator;
public:
    class node;
    class edge;
    typedef std::set<edge*, ptr_cmp<edge, std::less<edge> >, sub_allocator> edgeset;
    typedef std::set<node*, ptr_cmp<node, P>, sub_allocator> nodeset;
    typedef typename std::set<edge*, ptr_cmp<edge, std::less<edge> >, sub_allocator>::const_iterator edgeiter;
    typedef typename std::set<node*, ptr_cmp<node, P>, sub_allocator>::const_iterator nodeiter;

    class node { /*SNIP*/};
    class edge { /*SNIP*/};

    hypergraph(P pred=P(), A alloc=A());

    nodeiter add_node(); /* beginning of 8 with the error */
    nodeiter add_node(const T& rhs);
    nodeiter add_node(T&& rhs);
    nodeiter add_edge();
    nodeiter erase(nodeiter iter);
    nodeiter erase(node* iter);
    nodeiter erase(edgeiter iter);
    nodeiter erase(edge* iter);  /* end of 8 with the error */

    const nodeset& nodes() const;
    const edgeset& edges() const;

    A get_allocator() const;
protected:
    hypergraph(const hypergraph& rhs);
    hypergraph& operator=(const hypergraph& rhs);
    A a_;
    nodeset nodes_;
    edgeset edges_;
    unsigned int edgecount_;
};

And this function definition:

template<class T, class P, class A>
typename hypergraph<T,P,A>::node_iter hypergraph<T,P,A>::add_edge()
{
    std::unique_ptr<edge> ptr = new edge(edgecount_++, sub_allocator(a_));
    std::pair<edgeiter, bool> r = edges_.insert(ptr);
    ptr.release();
    return r.first;
}

I’m sure it’s a stupid thing, but I can’t figure out why MSVC10 can’t match that prototype to that function.

And I think this code has an issue with const-ness, caused by containers of pointers, but I’ll address that in a separate question.

  • 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-27T08:22:43+00:00Added an answer on May 27, 2026 at 8:22 am

    Return value:

    typename hypergraph<T,P,A>::node_iter
    

    should be:

    typename hypergraph<T,P,A>::nodeiter
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While attempting to link with QT 4.5 release, I run into this error message
i am getting this error on the asp.net mvc default site when i try
while attempting to run rake, I run into the following error: heroku rake db:migrate
While attempting to use the CopyFile() function I have encountered a strange error. It
While attempting to get an old svn dump of a project under git control,
While attempting my first sub-class in Objective-C I have come across the following warning
Occasionally while attempting to save a Crystal Report that I'm working on in VS2008,
Note : No MFC No ATL Using Visual C++ While attempting a connection between
While attempting to execute SQL insert statements using Oracle SQL Developer I keep generating
I've been struggling for a while now trying to figure this out and I'm

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.