Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2007-07-08 08:54:24


On 07/07/2007 11:49 AM, Eric Niebler wrote:
[snip]
> template<typename Expr>
> struct wrap
> {
> explicit wrap(Expr const &expr)
> {}
> };
>
Thanks very much Eric; however, I found that with the following:

      template<typename Expr>
      struct wrap
      #define INHERIT_EXPR
      #ifdef INHERIT_EXPR
      : Expr
      #endif
      {
          explicit wrap(Expr const &expr)
          {
              std::cout<<"Wrap::CTOR\n";
          }
      };

the wrap CTOR is not called when:

          WrapItUp::call( _1 + _2, i, i );

is executed. OTOH, if INHERIT_EXPR is undefined,
then wrap CTOR *is* called. There must be some typedef needed
by wrap in order for WrapItUp::call to actually call
the wrap CTOR. I'll start looking for it, but I'd
appreciate any clues.

TIA.

-Larry


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