Boost logo

Boost Users :

Subject: [Boost-users] boost tti has_member_function
From: Matei David (matei_at_[hidden])
Date: 2014-05-05 12:34:31


I'm trying to use boost tti has_member_function to test if a
user-specified allocator has the expected methods. However, this fails
with standard allocators.

#include <iostream>
#include <memory>
#include <boost/tti/has_member_function.hpp>
BOOST_TTI_HAS_MEMBER_FUNCTION(deallocate)
typedef std::allocator< int > T;
int main()
{
    std::cout << has_member_function_deallocate<
        void (T::*) (T::pointer, T::size_type)
>::value << "\n";
}

I tried gcc-4.8.2 and clang-3.4. I'm compiling with:
{g++|clang++} -std=c++11 -I${BOOST}/include -Wall -Wextra
-pedantic -Wno-ignored-qualifiers -g3 -O0

In both cases, I get a 0. However, using "-E" and grep-ing for
"\<deallocate\>", I see this signature:

void deallocate(pointer __p, size_type)

Shouldn't I be getting a 1? Am I using it the wrong way?

Thanks


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