Boost logo

Boost Users :

Subject: Re: [Boost-users] [proto] : Using proto with NVIDIA CUDA nvcc (redux)
From: Eric Niebler (eric_at_[hidden])
Date: 2010-10-29 01:01:07


On 10/28/2010 9:07 PM, Manjunath Kudlur wrote:
> t.cudafe1.stub.c:8: error: invalid cast from type ‘const
> expr<boost::proto::exprns_::basic_expr<boost::proto::tag::address_of,

Proto overloads the addressof operator (unary &) to build a tree node.
It seems somewhere someone is trying to take the address of proto
expression and getting a new object instead. (Whoever it is should be
using boost::addressof, or the equivalent. That's busted.) Proto
address_of nodes are implicitly convertible to an expression pointer to
generally avoid this sort of problem, but it looks like the compiler is
trying to cast to "char*" instead. (That's also busted.)

The workaround would be to disable Proto's operator overload.

struct domain
  : proto::domain<
       proto::pod_generator<expr>
     , proto::not_<proto::address_of<proto::_> >
>
{};

HTH,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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