ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
RE: [boost] boost bind/functional/reference wrapper/mem_fn
by Yitzhak Sapir other posts by this author
Jan 30 2002 2:39PM messages near this date
RE: [boost] Boost.Format review comments - [] vs % | Re: [boost] boost bind/functional/reference wrapper/mem_fn
The talk of inline functions gave me an idea. How about doing something
like this as a workaround:
template<class A1>  class list1
{
public:
[...]
BOOST_BIND_INLINE A1 operator[] (arg<1> ) const { return a1_; }
BOOST_BIND_INLINE A1 operator[] (arg<1> (*)()) const { return a1_; }
[..] (same for all lists)

[...]
template<int I>  struct add_value<arg<I> >
{
typedef arg<I>  type;
};

template<int I>  struct add_value<arg<I>(*)() >
{
typedef arg<I>  type;
};
[...]
template<int I>  BOOST_BIND_INLINE _avt_r1 _avt_f(arg<I>);
template<int I>  BOOST_BIND_INLINE _avt_r1 _avt_f(arg<I>(*)());
[...]
namespace
{
inline boost::_bi::arg<1>  _1() { return boost::_bi::arg<1>(); };
inline boost::_bi::arg<2>  _2() { return boost::_bi::arg<2>(); };
inline boost::_bi::arg<3>  _3() { return boost::_bi::arg<3>(); };
inline boost::_bi::arg<4>  _4() { return boost::_bi::arg<4>(); };
inline boost::_bi::arg<5>  _5() { return boost::_bi::arg<5>(); };
inline boost::_bi::arg<6>  _6() { return boost::_bi::arg<6>(); };
inline boost::_bi::arg<7>  _7() { return boost::_bi::arg<7>(); };
inline boost::_bi::arg<8>  _8() { return boost::_bi::arg<8>(); };
inline boost::_bi::arg<9>  _9() { return boost::_bi::arg<9>(); };
}

This way it can remain one header with no extra defines based on whether
you want/don't want precompiled headers. Or is something wrong with
this code?

-----Original Message-----
From: Peter Dimov [mailto: pdimov@[...].. ]
Sent: Wednesday, January 30, 2002 1:33 PM
To: boost@[...].com
Subject: Re: [boost] boost bind/functional/reference wrapper/mem_fn


>  The problem is not related to libraries as I first suspected (although
>  the linkage of the library is the first place it shows up), but rather
>  to precompiled headers. This is the default for newly created
projects
>  in MSVC usually. It is not documented that bind cannot be used in
>  precompiled headers. It is for this failure to compile that I asked
>  that they be macros.

I've moved the placeholders to their own header,
boost/bind/placeholders.hpp. bind.hpp now includes this header unless
BOOST_BIND_NO_PLACEHOLDERS is defined. The placeholders are now of type
boost::arg<N>  (they were of type boost::_bi::arg<N>); arg<> is defined
in
boost/bind/arg.hpp.



Info: http://www.boost.org Send unsubscribe requests to:
<mailto: boost-unsubscribe@[...].com> =20

Your use of Yahoo! Groups is subject to
 http://docs.yahoo.com/info/terms/=20
Thread:
Yitzhak Sapir
Peter Dimov
Fernando Cacciola
Fernando Cacciola

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved