Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2007-07-27 20:53:06


on Fri Jul 27 2007, "JOAQUIN LOPEZ MU?Z" <joaquin-AT-tid.es> wrote:

> According to the MPL reference, a placeholder expression
> X<a1,..,an> must satisfy (among others) the following
> condition:
>
> "All of X's template parameters, including the
> default ones, are types."
>
> According to that the following should then compile
> without errors:
>
> #include <boost/mpl/apply.hpp>
> #include <boost/mpl/assert.hpp>
> #include <boost/type_traits/is_same.hpp>
>
> using namespace boost;
> using namespace boost::mpl;
>
> template<typename T,int=0>
> struct foo
> {
> template<typename Q>
> struct apply{
> typedef Q type;
> };
> };
>
> typedef apply1<foo<_1>,int>::type t1;
>
> BOOST_MPL_ASSERT((is_same<t1,int>));
>
> int main(){}

I don't see how you can conclude the above will compile without error
just from (a part of) the definition of placeholder expression.

Are you saying that since foo<_1> is not a placeholder expression,
when applied to int it should be treated as a metafunction class?

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.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