Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Function in 1.37.0
From: Tad Yeager (tad_yeager_at_[hidden])
Date: 2009-01-08 20:50:56


OvermindDL1 <overminddl1 <at> gmail.com> writes:

(...)

> >>>
> >>>
28>c:\software\boost\boost_1_37_0\boost_1_37_0\boost\function
\function_template.hpp(80)
> >>> : error C2143: syntax error : missing ';' before 'namespace'
> >>>
> >>>
28>c:\software\boost\boost_1_37_0\boost_1_37_0\boost\function
\function_template.hpp(980)
> >>> : error C2838: '()' : illegal qualified name in member declaration
> >>>
> >>> 28>
> >>>
c:\software\boost\boost_1_37_0\boost_1_37_0\boost\function
\function_template.hpp(80)
> >>> : see reference to class template instantiation 'boost::function0<R>'
> >>> being
> >>> compiled
> >>>
> >>>
28>c:\software\boost\boost_1_37_0\boost_1_37_0\boost\function
\function_template.hpp(995)
> >>> : error C2804: binary 'operator ==' has too many parameters
> >>>
> >>>
28>c:\software\boost\boost_1_37_0\boost_1_37_0\boost\function
\function_template.hpp(1002)
> >>> : error C2804: binary 'operator !=' has too many parameters
> >>>
> >>>
> >>>

(...)

I'm getting the same error with msvc9. Here's all that's needed to repro:

#include <boost/function.hpp>

I get 100+ compilation errors prior to getting to any non-boost code,
starting with this error:
\import\boost_1_37_0\include\boost/function/function_template.hpp(80) :
error C2143: syntax error : missing ';' before 'namespace'

I suspect a configuration error; I've looked at BOOST_FUNCTION_NUM_ARGS
and other definitions. Adding a pragma once in some of the boost headers
gets me past the first error, but the rest remain.

Reverting back to the original, with functional.hpp included first,
compiling with /p option shows (which expands macros) the following output
(skipped ahead to relevant parts,
 ellipsis added to cut out some noise (more filename listings)):

namespace boost {

#line 23 \import\\boost_1_37_0\\include\\boost/type_traits/is_void.hpp

template< typename T > struct is_void :
::boost::integral_constant<bool,false>
{ };

template<> struct is_void< void > :
::boost::integral_constant<bool,true>
{ };

template<> struct is_void< void const > :
::boost::integral_constant<bool,true>
{ };

template<> struct is_void< void volatile > :
::boost::integral_constant<bool,true> { };

template<> struct is_void< void const volatile > :
::boost::integral_constant<bool,true> { };
#line 31 \import\\boost_1_37_0\\include\\boost/type_traits/is_void.hpp
#line 33 \import\\boost_1_37_0\\include\\boost/type_traits/is_void.hpp

}

#line 1 \import\\boost_1_37_0\\include\\boost/type_traits/detail
/bool_trait_undef.hpp"
#line 37 \import\\boost_1_37_0\\include\\boost/type_traits/is_void.hpp
#line 39 \import\\boost_1_37_0\\include\\boost/type_traits/is_void.hpp
(...)
#line 1 \import\\boost_1_37_0\\include\\boost/function/function_template.hpp
#line 1 \import\\boost_1_37_0\\include\\boost/function/detail/prologue.hpp
#line 14 \import\\boost_1_37_0\\include\\boost/function/function_template.hpp

#pragma warning( push )
#pragma warning( disable : 4127 )

#line 19 \import\\boost_1_37_0\\include\\boost/function/function_template.hpp

#line 41 \import\\boost_1_37_0\\include\\boost/function/function_template.hpp

#line 79 \import\\boost_1_37_0\\include\\boost/function/function_template.hpp

namespace boost {
  namespace detail {
    namespace function {
      template<
        typename FunctionPtr,
        typename R
        
>
      struct function_invoker0
      {
        static R invoke(function_buffer& function_ptr
                        )
        {
          FunctionPtr f =
reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
          return f();
        }
      };

      template<
        typename FunctionPtr,
        typename R
        
(...)

And the first error is at line 80, ("namespace boost") as in the original
posting. Any help would be greatly appreciated.
Thanks.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net