Boost logo

Boost :

Subject: Re: [boost] [bind] Error C4430 in bind.hpp
From: Darren Garvey (darren.garvey_at_[hidden])
Date: 2012-03-15 16:16:36


On 15 March 2012 12:22, Robert Dailey <rcdailey_at_[hidden]> wrote:

> On Thu, Mar 15, 2012 at 11:06 AM, Darren Garvey <darren.garvey_at_[hidden]
> >wrote:
>
> > On 15 March 2012 11:59, Robert Dailey <rcdailey_at_[hidden]> wrote:
> >
> > > On Thu, Mar 15, 2012 at 9:25 AM, Lars Viklund <zao_at_[hidden]> wrote:
> > >
> > > > On Thu, Mar 15, 2012 at 08:25:54AM -0500, Robert Dailey wrote:
> > > > > >> For some reason when I include <boost/bind.hpp> I get the
> > following
> > > > > >> errors:
> > > > > >>
> > > > > >>
> > > >
> > >
> >
> 1>c:\code\work\cmake-mds\build-vc9\third_party\boost\1.48.0\include\boost\bind\bind.hpp(1200)
> > > > > >> : error C4430: missing type specifier - int assumed. Note: C++
> > does
> > > > not
> > > > > >> support default-int
> > >
> > > > [snip]
> > > >
> > > > > >>
> > > > > >> They point to this code in bind.hpp:
> > > > > >>
> > > > > >> BOOST_BIND_OPERATOR( ==, equal )
> > > >
> > > > [snip]
> > >
> > > Thanks for the help. I generated a preprocessed file for this
> translation
> > > unit (the one including bind.hpp) and I see the following generated
> code:
> > >
> > > struct equal { template<class V, class > bool operator()(V const & v,
> > > const & w) const { return v == w; } }; template<class R, class F,
> class
> > L,
> > > class A2> bind_t< bool, equal, list2< bind_t<R, F, L>, typename
> > > add_value<A2>::type > > operator == (bind_t<R, F, L> const & f, A2 a2)
> {
> > > typedef typename add_value<A2>::type B2; typedef list2< bind_t<R, F,
> L>,
> > > B2> list_type; return bind_t<bool, equal, list_type> ( equal(),
> > > list_type(f, a2) ); }
> > >
> >
> > Seems like the upper-case 'W' character is not being expanded properly.
> I'm
> > assuming you don't have anything crazy in your code base that defines 'W'
> > to be nothing?
>
>
> Oh man, good find. We are using the IBM Lotus Notes API and it defines W to
> signify that we are on Windows. Kinda silly... I guess I'll #undef it for
> now. Really annoying though. Maybe in a future update to boost the template
> parameters could be given more unique names? Not that this is really
> boost's problem :)
>

Better still, the standard could say that single characters shall not be
macro defines. Common sense does already!

Ah, the good old Notes API (or in fact anything Lotus Notes) - what a
disaster. I once wrote a thin Boost.Python wrapper over most of the Notes
C++ API; I laid it to rest on sourceforge (
http://sourceforge.net/projects/notespy/) if you'd prefer to have a less
painful interface to use. :)

Cheers,

Darren


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk