Boost logo

Boost :

Subject: Re: [boost] [type traits] is_literal_type ?
From: John Maddock (boost.regex_at_[hidden])
Date: 2013-03-02 13:09:36


>> Can you give an example of how it's usage would be?
>
> Sort an interesting question. I'm imagining something like:
>
> template<class T>
> int f(T const & t){
> if(std::is_lteral_type<T>)
> return t;
> else
> return g(t); // do some sort of conversion
> }
>
> in order to skip instantiation/invokation of g when it isn't necessary in
> this example.

That wouldn't work - just because a type is a literal type doesn't mean that
it's convertible to int. In that particular case wouldn't is_convertible
do?

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk