Boost logo

Boost Users :

Subject: Re: [Boost-users] trick to print a type at compile-time
From: Hicham Mouline (hicham_at_[hidden])
Date: 2010-09-08 08:24:03


"Emil Dotchevski" <emil_at_[hidden]> wrote in message
news:AANLkTi=3ZkQBNUPQsWy=oxcUdzDpm5XDk8b0qgFS0zoW_at_mail.gmail.com...
On Wed, Sep 8, 2010 at 12:08 AM, Hicham Mouline <hicham_at_[hidden]> wrote:
> Hello,
>
>
>
> Is there a way to print the type returned by a metafunction
>
> typedef some_metafunction<T>::type result_type;
>
>
>
> during compile-time (probably via triggering a compilation error).
>
> I almost recall some sort of static assertion (mpl ?) to do this.

If all you want is an error you could do typedef typename
some_metafunction<T>::result_type error[0] or something like that.

Emil Dotchevski

----------------------
I'd like to print result_type, I don't know what it is.
Shouldn't I make result_type a parameter to some template that just triggers
an error printout when it is instantiated?

would
  typedef typename some_metafunction<T>::result_type error[0]
print what is result_type?

thank you,

regards,


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