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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:34:38+00:00 2026-06-01T12:34:38+00:00

This code compiles fine with GCC and Clang but not with MSVC 2010: #include

  • 0

This code compiles fine with GCC and Clang but not with MSVC 2010:

#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <boost/function.hpp>
#include <list>
#include <string>

enum Actions {};
std::string eventStart(size_t index, Actions action, std::list<std::string> const& = std::list<std::string>()) { return ""; }

static void test() {
    using namespace boost::lambda;
    size_t i = 0;
    int action = 0;
    boost::function<std::string (std::list<std::string> const&)> startF = bind(eventStart, i, (Actions)action, _1);
}

gives the error:

1>c:\users\albert zeyer\documents\visual studio 2010\projects\test\test\test2.cpp(14): error C2383: 'T0': Für dieses Symbol sind Standardargumente nicht zulässig
1>          c:\users\albert zeyer\documents\visual studio 2010\projects\test\test\test2.cpp(14): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::lambda::detail::bind_tuple_mapper<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>".
1>          with
1>          [
1>              T0=std::string (size_t,Actions,const std::list<std::string> &),
1>              T1=const size_t,
1>              T2=const Actions,
1>              T3=boost::lambda::placeholder1_type,
1>              T4=boost::tuples::null_type,
1>              T5=boost::tuples::null_type,
1>              T6=boost::tuples::null_type,
1>              T7=boost::tuples::null_type,
1>              T8=boost::tuples::null_type,
1>              T9=boost::tuples::null_type
1>          ]
1>c:\users\albert zeyer\documents\visual studio 2010\projects\test\test\test2.cpp(14): error C2383: 'Arg1': Für dieses Symbol sind Standardargumente nicht zulässig

(off topic: how can I get the error in English?)

Using &eventStart instead also doesn’t work but the error is different:

1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallfun(7): error C2664: 'std::string (size_t,Actions,const std::list<_Ty> &)': Konvertierung des Parameters 3 von 'const boost::lambda::placeholder1_type' in 'const std::list<_Ty> &' nicht möglich
1>          with
1>          [
1>              _Ty=std::string
1>          ]
1>          Ursache: Konvertierung von 'const boost::lambda::placeholder1_type' in 'const std::list<_Ty>' nicht möglich
1>          with
1>          [
1>              _Ty=std::string
1>          ]
1>          Kein benutzerdefinierter Konvertierungsoperator verfügbar, der diese Konvertierung durchführen kann, oder der Operator kann nicht aufgerufen werden
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxbind1(292): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "_Ret std::tr1::_Callable_fun<_Ty,_Indirect>::_ApplyX<_Ret,_Arg&,Actions&,boost::lambda::lambda_functor<T>&>(_Arg0,_Arg1,_Arg2) const".
1>          with
1>          [
1>              _Ret=_Rx,
1>              _Ty=std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),
1>              _Indirect=false,
1>              _Arg=size_t,
1>              T=boost::lambda::placeholder<1>,
1>              _Arg0=size_t &,
1>              _Arg1=Actions &,
1>              _Arg2=const boost::lambda::placeholder1_type &
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxbind0(31): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "_Ret std::tr1::_Bind3<_Callable,_Arg0,_Arg1,_Arg2>::_ApplyX<_Rx,const std::list<_Ty>&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&,std::tr1::_Nil&>(_Barg0,_Barg1,_Barg2,_Barg3,_Barg4,_Barg5,_Barg6,_Barg7,_Barg8,_Barg9)".
1>          with
1>          [
1>              _Ret=_Rx,
1>              _Callable=std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,
1>              _Arg0=size_t,
1>              _Arg1=Actions,
1>              _Arg2=const boost::lambda::placeholder1_type,
1>              _Ty=std::string,
1>              _Barg0=const std::list<std::string> &,
1>              _Barg1=std::tr1::_Nil &,
1>              _Barg2=std::tr1::_Nil &,
1>              _Barg3=std::tr1::_Nil &,
1>              _Barg4=std::tr1::_Nil &,
1>              _Barg5=std::tr1::_Nil &,
1>              _Barg6=std::tr1::_Nil &,
1>              _Barg7=std::tr1::_Nil &,
1>              _Barg8=std::tr1::_Nil &,
1>              _Barg9=std::tr1::_Nil &
1>          ]
1>          c:\program files (x86)\boost\boost_1_47\boost\function\function_template.hpp(132): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "std::basic_string<_Elem,_Traits,_Ax> std::tr1::_Bind_base<_Ret,_BindN>::operator ()<const std::list<_Ty>&>(_Carg0)".
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Ax=std::allocator<char>,
1>              _Ret=std::string,
1>              _BindN=std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>,
1>              _Ty=std::string,
1>              _Carg0=const std::list<std::string> &
1>          ]
1>          c:\program files (x86)\boost\boost_1_47\boost\function\function_template.hpp(126): Bei der Kompilierung der  Klassen-template der std::string boost::detail::function::function_obj_invoker1<FunctionObj,R,T0>::invoke(boost::detail::function::function_buffer &,T0)-Memberfunktion
1>          with
1>          [
1>              FunctionObj=std::tr1::_Bind<std::string,std::string,std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>>,
1>              R=std::string,
1>              T0=const std::list<std::string> 
1>          ]
1>          c:\program files (x86)\boost\boost_1_47\boost\function\function_template.hpp(907): Siehe Verweis auf die Instanziierung der gerade kompilierten Klassen-template "boost::detail::function::function_obj_invoker1<FunctionObj,R,T0>".
1>          with
1>          [
1>              FunctionObj=std::tr1::_Bind<std::string,std::string,std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>>,
1>              R=std::string,
1>              T0=const std::list<std::string> 
1>          ]
1>          c:\program files (x86)\boost\boost_1_47\boost\function\function_template.hpp(722): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "void boost::function1<R,T0>::assign_to<Functor>(Functor)".
1>          with
1>          [
1>              R=std::string,
1>              T0=const std::list<std::string> ,
1>              Functor=std::tr1::_Bind<std::string,std::string,std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>>
1>          ]
1>          c:\program files (x86)\boost\boost_1_47\boost\function\function_template.hpp(1043): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "boost::function1<R,T0>::function1<std::tr1::_Bind<_Result_type,_Ret,_BindN>>(Functor,int)".
1>          with
1>          [
1>              R=std::string,
1>              T0=const std::list<std::string> ,
1>              _Result_type=std::string,
1>              _Ret=std::string,
1>              _BindN=std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>,
1>              Functor=std::tr1::_Bind<std::string,std::string,std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>>
1>          ]
1>          c:\users\albert zeyer\documents\visual studio 2010\projects\test\test\test2.cpp(14): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "boost::function<Signature>::function<std::tr1::_Bind<_Result_type,_Ret,_BindN>>(Functor,int)".
1>          with
1>          [
1>              Signature=std::string (const std::list<std::string> &),
1>              _Result_type=std::string,
1>              _Ret=std::string,
1>              _BindN=std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>,
1>              Functor=std::tr1::_Bind<std::string,std::string,std::tr1::_Bind3<std::tr1::_Callable_fun<std::string (__cdecl *const )(size_t,Actions,const std::list<std::string> &),false>,size_t,Actions,const boost::lambda::placeholder1_type>>
1>          ]

Why? The code seems correct.

It works when I remove the default argument for the eventStart function.

  • 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-01T12:34:39+00:00Added an answer on June 1, 2026 at 12:34 pm

    As ildjarn suggested, I use &eventStart instead of eventStart. That alone didn’t yet work for me.

    But when I change bind to boost::lambda::bind, it works.

    This is strange however because there is no using namespace std; or so.

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

Sidebar

Related Questions

This compiles fine in MSVC but gcc complains. The code on ideone . I
The following code does not compile with gcc 4.7 (20120114) , but compiles fine
This code compiles just fine on gcc, but when using llvm (llvm-gcc), it says
This code below compiles fine with VS2010 but doesn't want to compile with gcc
I wrote this code that compiles on Solaris gcc it works fine too for
This code compiles, and runs successfully locally, but not on another server. Both machines
I am unclear about the following. First, this code compiles fine: #include <vector> typedef
This code compiles fine with Visual C++ 11 Developer Preview but won't compile with
The following code snippet compiles just fine on Mac OS X with gcc, but
This code compiles fine: {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, FlexibleContexts, EmptyDataDecls, ScopedTypeVariables, TypeOperators,

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.