Boost logo

Boost :

Subject: Re: [boost] [type traits] is_literal_type ?
From: Robert Ramey (ramey_at_[hidden])
Date: 2013-03-02 13:04:49


Rodrigo Madera wrote:
> On Thu, Feb 28, 2013 at 6:32 AM, John Maddock
> <boost.regex_at_[hidden]>wrote:
>
>> Any chance of a boost implementation for is_literal_type?
>>
>>
> Robert,
>
> 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.

> I suspect that you may want something illegal in C++.it's part of the
> standard - see section 20.9.2 - so ...

- any C++ not delivered with an implementation is not a conforming C++
compiler.
- no C++ compilers (as far as I know) are delivered with this type trait
- hence, there are no conforming C++ compilers available.

What is even more odd to me, is that it seems that a type trait required
by the standard library can't be implemented by the language as
specified by the standard.

I'm wondering if I should go to one of these standards meeetings
sometime.

Robert Ramey

> Rodrigo
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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