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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:54:47+00:00 2026-06-02T10:54:47+00:00

I have a strange issue with std::less. indexedpriorityq.hpp(21): error C2661: ‘std::less<_Ty>::less’ : no overloaded

  • 0

I have a strange issue with std::less.

indexedpriorityq.hpp(21): error C2661: 'std::less<_Ty>::less' : no overloaded function takes 2 arguments
1>          with
1>          [
1>              _Ty=float
1>          ]

But isn’t that what it’s supposed to do?

Here’s some of my code:

template<class KeyType, class binary_predicate = std::less<KeyType> >
class IndexedPriorityQ
{
 private:
    typedef typename std::vector<KeyType> KEYLIST;
    KEYLIST& m_Keys_V;

    [...]
};

template<class KeyType, class binary_predicate>
void IndexedPriorityQ<KeyType, binary_predicate>::
    ReorderUpwards(int size)
{
    while( (size>1) && 
        (binary_predicate(m_Keys_V[m_Heap_V[size]], m_Keys_V[m_Heap_V[size/2]])) //breaks here
         )
    {
        Swap(size/2, size);
        size /= 2;
    }
}

What exactly is causing the error, and how can I fix 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-02T10:54:53+00:00Added an answer on June 2, 2026 at 10:54 am

    std::less is a functor, and its constructor takes 0 arguments. That is, you create the objcet like this:

    std::less<Key> a;
    

    Then, you use it like this:

    if(a(x,y)) ...
    

    or even

    if(std::less<Key>()(x,y)) ...
    

    There are functors whose constructor takes more than 0 arguments, like std::bind1st. The rule is that if the functor is binary, it is its operator() that takes 2 arguments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
I have a strange issue. It almost seems like a bug. if ($object->error) {Form::BuildReturn();
I have a strange issue. Here is the error message: Call to undefined method
I have a strange issue today related to the oci_bind_by_name function I use in
I have some strange issue with isset() function in PHP. Let me show... .
I have a strange issue with sending a mail with php, here is my
I have this strange issue. When I run application from Xcode (even on device),
I have a strange issue with a Widget that I am trying to create.
I have this strange issue. I have an image which I rotate about a
Hello have following strange issue, can vertical center the menu text if it's one

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.