Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPL] return type
From: Igor R (boost.lists_at_[hidden])
Date: 2011-10-10 09:45:24


> Every type in the sequence has the following form:
>
> struct sequence_item
> {
>     typedef the_real_type type ;
>     static the_real_type *parse( const QDomElement & ) ;
> } ;
>
>
> The code for iterating over the sequence is the following:
>
>
> template < typename It, typename End >
> ?? *dispatchM( const QDomElement &, mpl::true_ /* endofvec */ )
> {
>     return 0 ;
> }
>
>
> template < typename It, typename End >
> ?? *dispatchM( const QDomElement &element, mpl::false_ )
> {
>     typedef typename mpl::deref< It >::type MapEntry ;
>     if ( element.tagName() == MapEntry::first::name() )

The above line means that you figure out the correct type in
*run-time*, don't you?
But the result type must be known in compile-time.


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