"Rozental, Gennadiy" <[EMAIL PROTECTED]> writes:

> Hi,
>
> Is there neat way with MPL to implement conditional expessions without
> introducing aditional structures. For example:
>
> template<typename Container>
> void
> foo( Container& c ) 
> {
> // pseudo code
>    [if ( c is reservable , i.e. has method reserve )
>        c.reserve( 100 );
>    ]
>    ...    
> }
>
> Gennadiy.

If I understand the question correctly (not sure I do because it's
vaguely worded), the answer is no.  C++ compilation in general is not
lazy, so you can't defer the call to reserve() unless you go through a
level of template indirection.

-- 
                       David Abrahams
   [EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to