Boost logo

Boost :

Subject: Re: [boost] [type_traits] Rewrite and dependency free version
From: John Maddock (boost.regex_at_[hidden])
Date: 2015-01-15 13:13:18


>> Although, now that I think of it, creating 'void() const' is in
>> principle possible in C++03 as well. Not sure what the old type traits
>> did with such types.
>
> boost::is_function<void() const> says 0, even in C++11 mode.
>
> #include <boost/type_traits/is_function.hpp>
> #include <boost/core/demangle.hpp>
> #include <iostream>
> #include <typeinfo>
>
> struct X
> {
> void f() const {}
> };
>
> template< class T > struct Y
> {
> };
>
> template< class C, class F > void test( F C::* /*pf*/ )
> {
> std::cout << boost::core::demangle( typeid( F ).name() ) << std::endl;
> std::cout << boost::core::demangle( typeid( Y<F> ).name() ) <<
> std::endl;
> std::cout << boost::is_function< F >::value << std::endl;
> }
>
> int main()
> {
> test( &X::f );
> }

Peter, can you file a bug report so this doesn't get lost?

I'm trying hard to *not* change semantics or implementation strategy at
this stage. One thing at a time!

Thanks, John.


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