Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-11-11 09:02:40


On Monday 11 November 2002 04:56 am, Aleksey Gurtovoy wrote:
[snip my limited example]
> Hmm, interesting, so if this actually worked, we would be happy:
>
[snip nifty-looking is_callable implementation]
>
> ?

Well, you need to do some trickery to make it work when R=void, but otherwise
I think we would be _very_ happy if this worked. Is there a tweak to the core
language that would guarantee such a thing?

> > The reason I mention is_instantiable instead of __is_well_formed
> > is that is_instantiable can keep a class template interface, whereas
> > __is_well_formed would require a new grammar production.
>
> From http://aspn.activestate.com/ASPN/Mail/Message/1412095 I've got an
> impression that implementors are not too concerned about it.
>
> After all, '__is_well_formed' might be as easy to implement as this:
>
> void process_is_well_formed( args )
> {
> try
> {
> process_sizeof( args );
> args.expression_result = true;
> }
> catch (compiler_error const& )
> {
> args.expression_result = false;
> }
> }
>
> :)

At one time in GCC, checking for compilability was as easy as:

  cp_silent++;
  // instantiate the thing you want to check
  cp_silent--;
  
        Doug


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