T
Tim H
Compiling with g++ 4:
This line:
if_then_else_return(_1 == 0, 64, _1)
When called with a bignum class as an argument yields:
/usr/include/boost/lambda/if.hpp: In member function 'RET
boost::lambda::lambda_
functor_base<boost::lambda:ther_action<boost::lambda::ifthenelsereturn_action>
, Args>::call(A&, B&, C&, Env&) const [with RET = const bignum&, A =
const bignu
m, B = const boost::tuples::null_type, C = const
boost::tuples::null_type, Env =
const boost::tuples::null_type, Args =
boost::tuples::tuple<boost::lambda::lamb
da_functor<boost::lambda::lambda_functor_base<boost::lambda::relational_action<b
oost::lambda::equal_action>,
boost::tuples::tuple<boost::lambda::lambda_functor<
boost::lambda:laceholder<1> >, const int, boost::tuples::null_type,
boost::tup
les::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuple
s::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples:
:null_type> > >, const int,
boost::lambda::lambda_functor<boost::lambda:laceho
lder<1> >, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::nu
ll_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null
_type, boost::tuples::null_type>]':
/usr/include/boost/lambda/detail/lambda_functors.hpp:148:
instantiated from 't
ypename T::sig<boost::tuples::tuple<A&, boost::tuples::null_type,
boost::tuples:
:null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::n
ull_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::nul
l_type, boost::tuples::null_type> >::type
boost::lambda::lambda_functor<Base>:
perator()(A&) const [with A = const bignum, T =
boost::lambda::lambda_functor_ba
se<boost::lambda:ther_action<boost::lambda::ifthenelsereturn_action>,
boost::t
uples::tuple<boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<bo
ost::lambda::relational_action<boost::lambda::equal_action>,
boost::tuples::tupl
e<boost::lambda::lambda_functor<boost::lambda:laceholder<1> >, const
int, boos
t::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost:
:tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::t
uples::null_type, boost::tuples::null_type> > >, const int,
boost::lambda::lambd
a_functor<boost::lambda:laceholder<1> >, boost::tuples::null_type,
boost::tupl
es::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples
::null_type, boost::tuples::null_type, boost::tuples::null_type> >]'
.../pp_datatypes.h:454: instantiated from 'std::string
pp_transform_datatype<Td
efunc, Tenfunc>::evaluate(const pp_value&) const [with Tdefunc =
boost::lambda::
lambda_functor<boost::lambda::lambda_functor_base<boost::lambda:ther_action<bo
ost::lambda::ifthenelsereturn_action>,
boost::tuples::tuple<boost::lambda::lambd
a_functor<boost::lambda::lambda_functor_base<boost::lambda::relational_action<bo
ost::lambda::equal_action>,
boost::tuples::tuple<boost::lambda::lambda_functor<b
oost::lambda:laceholder<1> >, const int, boost::tuples::null_type,
boost::tupl
es::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples
::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::
null_type> > >, const int,
boost::lambda::lambda_functor<boost::lambda:lacehol
der<1> >, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::nul
l_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_
type, boost::tuples::null_type> > >, Tenfunc =
boost::lambda::lambda_functor<boo
st::lambda::lambda_functor_base<boost::lambda::arithmetic_action<boost::lambda::
minus_action>,
boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda:
laceholder<1> >, const int, boost::tuples::null_type,
boost::tuples::null_type
, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >
/usr/include/boost/lambda/if.hpp:315: warning: returning reference to
temporary
make[2]: *** [cpuid/generic_device.o] Error 1
make[1]: *** [devices] Error 2
make: *** [devices/all_devices.o] Error 2
cpuid/generic_device.cpp:419 is the last line of the file before the
final function's closing curly.
Changing the second _1 to an integer literal works.
I'm pretty much out of template-fu at this point...
Help?
This line:
if_then_else_return(_1 == 0, 64, _1)
When called with a bignum class as an argument yields:
/usr/include/boost/lambda/if.hpp: In member function 'RET
boost::lambda::lambda_
functor_base<boost::lambda:ther_action<boost::lambda::ifthenelsereturn_action>
, Args>::call(A&, B&, C&, Env&) const [with RET = const bignum&, A =
const bignu
m, B = const boost::tuples::null_type, C = const
boost::tuples::null_type, Env =
const boost::tuples::null_type, Args =
boost::tuples::tuple<boost::lambda::lamb
da_functor<boost::lambda::lambda_functor_base<boost::lambda::relational_action<b
oost::lambda::equal_action>,
boost::tuples::tuple<boost::lambda::lambda_functor<
boost::lambda:laceholder<1> >, const int, boost::tuples::null_type,
boost::tup
les::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuple
s::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples:
:null_type> > >, const int,
boost::lambda::lambda_functor<boost::lambda:laceho
lder<1> >, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::nu
ll_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null
_type, boost::tuples::null_type>]':
/usr/include/boost/lambda/detail/lambda_functors.hpp:148:
instantiated from 't
ypename T::sig<boost::tuples::tuple<A&, boost::tuples::null_type,
boost::tuples:
:null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::n
ull_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::nul
l_type, boost::tuples::null_type> >::type
boost::lambda::lambda_functor<Base>:
perator()(A&) const [with A = const bignum, T =
boost::lambda::lambda_functor_ba
se<boost::lambda:ther_action<boost::lambda::ifthenelsereturn_action>,
boost::t
uples::tuple<boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<bo
ost::lambda::relational_action<boost::lambda::equal_action>,
boost::tuples::tupl
e<boost::lambda::lambda_functor<boost::lambda:laceholder<1> >, const
int, boos
t::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost:
:tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::t
uples::null_type, boost::tuples::null_type> > >, const int,
boost::lambda::lambd
a_functor<boost::lambda:laceholder<1> >, boost::tuples::null_type,
boost::tupl
es::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples
::null_type, boost::tuples::null_type, boost::tuples::null_type> >]'
.../pp_datatypes.h:454: instantiated from 'std::string
pp_transform_datatype<Td
efunc, Tenfunc>::evaluate(const pp_value&) const [with Tdefunc =
boost::lambda::
lambda_functor<boost::lambda::lambda_functor_base<boost::lambda:ther_action<bo
ost::lambda::ifthenelsereturn_action>,
boost::tuples::tuple<boost::lambda::lambd
a_functor<boost::lambda::lambda_functor_base<boost::lambda::relational_action<bo
ost::lambda::equal_action>,
boost::tuples::tuple<boost::lambda::lambda_functor<b
oost::lambda:laceholder<1> >, const int, boost::tuples::null_type,
boost::tupl
es::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples
::null_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::
null_type> > >, const int,
boost::lambda::lambda_functor<boost::lambda:lacehol
der<1> >, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::nul
l_type, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_
type, boost::tuples::null_type> > >, Tenfunc =
boost::lambda::lambda_functor<boo
st::lambda::lambda_functor_base<boost::lambda::arithmetic_action<boost::lambda::
minus_action>,
boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda:
laceholder<1> >, const int, boost::tuples::null_type,
boost::tuples::null_type
, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >
cpuid/generic_device.cpp:419: instantiated from here
/usr/include/boost/lambda/if.hpp:315: warning: returning reference to
temporary
make[2]: *** [cpuid/generic_device.o] Error 1
make[1]: *** [devices] Error 2
make: *** [devices/all_devices.o] Error 2
cpuid/generic_device.cpp:419 is the last line of the file before the
final function's closing curly.
Changing the second _1 to an integer literal works.
I'm pretty much out of template-fu at this point...
Help?