Boost logo

Boost :

From: Seweryn Habdank-Wojewódzki (shw_at_[hidden])
Date: 2007-06-23 10:14:55


Hi again

I am little change this example and it contains interesting functionality:

#include <iostream>

template <class A>
class T {
  A a;
 };
 
class is_original_version_of_template
{
public:
     static bool const value;
};

bool const is_original_version_of_template::value
    (sizeof(T<void *>) == sizeof(T<void *>));
 
template <class A>
class T<A *> {
   A *a[10];
};

class is_not_original_version_of_template // specialized version
{
public:
     static bool const value;
};

bool const is_not_original_version_of_template::value
    (sizeof(T<void *>) == is_original_version_of_template::value);

int main()
{
    std::cout << "is_original_version_of_template "
        << is_original_version_of_template::value << '\n';

    std::cout << "is_not_original_version_of_template "
    << is_not_original_version_of_template::value << '\n';
}

Regards.

-- 
|\/\/|   Seweryn Habdank-Wojewódzki
 \/\/ 

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