Eric Niebler wrote:
> #include
> #include
> #include
> #include
> #include
> #include
> namespace proto = boost::proto;
> namespace mpl = boost::mpl;
> using proto::_;
>
> namespace My
> {
> struct my_tag {};
>
> template
> struct attribute_
> {
> BOOST_PROTO_BASIC_EXTENDS(
> proto::terminal::type
> , attribute_
> , proto::default_domain
> )
> };
>
> attribute_<> const attribute = {{}};
>
> struct BuildAttributes
> : proto::make<
> mpl::pop_front<
> proto::fold_tree<
> _
> , mpl::vector0<>()
> , mpl::push_back()
> >
> >
> >
> {};
> }
>
> int main()
> {
> mpl::vector3 x =
> My::BuildAttributes()(
> My::attribute << int() << std::string() << bool()
> );
> }
>
> HTH,

 
Hi Eric,
 
It does! It is way more elegant than what I came up with.
I can even add a few features (like an optional end) inside and it still compiles much faster.
 
Thanks a lot,
 
Christophe
 



With Windows Live, you can organize, edit, and share your photos.