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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:40:12+00:00 2026-05-16T17:40:12+00:00

Working on Windows with VS2005 and struggling to understand the error messages I’m getting.

  • 0

Working on Windows with VS2005 and struggling to understand the error messages I’m getting. If this question has been asked before, I’m sorry. I couldn’t find it.

Class I’m testing:

#include <functional>
using std::unary_function;

template<typename F, typename G>
struct UnaryConvolution : unary_function<typename G::argument_type,typename F::result_type>{
    UnaryConvolution(const F &_f, const G &_g) : m_F(_f), m_G(_g){}

    result_type operator()(const argument_type &_arg){
        return m_F( m_G( _arg ) );
    }

    F m_F;
    G m_G;
};

unit test I’ve written:

using std::bind2nd;
using std::equal_to;
using std::less;

bool unaryConvolution_test(){
    UnaryConvolution obj(bind2nd( equal_to<bool>(), true ), bind2nd( less<int>(), 5 ));

    return obj( 3 );
}

and errors I’m getting:

  1. error C2955: ‘UnaryConvolution’ : use of class template requires template argument list
  2. error C3848: expression having type ‘UnaryConvolution’ would lose some const-volatile qualifiers in order to call ‘_Result UnaryConvolution::operator ()(const _Arg &)’
  3. error C2514: ‘UnaryConvolution’ : class has no constructors

even adding the line int val = 3 and then passing val has no effect. (BTW, project is forbidden to use Boost or any 3rd party library. Don’t ask, I try not to.)

  • 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-16T17:40:12+00:00Added an answer on May 16, 2026 at 5:40 pm

    UnaryConvolution is a class template, not a class. You need to specify the template arguments with which to instantiate the template. For example,

    UnaryConvolution<
        function<bool(bool)>, 
        function<bool(int)>
    > obj(bind2nd( equal_to<bool>(), true ), bind2nd( less<int>(), 5 ));
    

    (I’ve used function, which you can get from Boost, C++ TR1, or C++0x, in place of the actual return type of bind2nd, which isn’t quite as straightforward. If you don’t have access to some implementation of function, then you’ll need to go figure out the return type of bind2nd)

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

Sidebar

Related Questions

I've been working on this Solution for a while now, but suddenly I'm getting
I have modified a working Windows service that had always been starting beforehand. After
I am working on Windows Server 2003 (IIS6), which has two asp.net sites running
I've been working in windows forms applications and ASP.Net applications for the past 10
I have a question about exception handling. To prevent the [YourProgram] has stopped working
I've been working with Windows API calls so that I can get some native
Occasionally working in Windows Vista the O.S. will desaturate the screen, rendering all colors
i'm working on windows mobile app (c#, .net 2.0). i would like to make
I m working on windows form application. I need to show amount in words
I am working with Windows Forms, is it possible to create a window which

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.