O
Oliver Kowalke
Hi,
following code will not compile with MS VC 7.1:
struct null_type;
template< bool B, typename T, typename E >
struct if_then_else;
template< typename T, typename E >
struct if_then_else< true, T, E >
{
typedef T result_type;
};
template< typename T, typename E >
struct if_then_else< false T, E >
{
typedef E result_type;
};
template< int N >
class A
{
private:
template< int M >
class X
{
typedef typename if_then_else< N <= M, A< M >, null_type >::result_type
result_type;
};
template< int M >
friend typename A< N >::X< M >::result_type;
//friend typename A::X< M >::result_type;
};
only such A< M > should become friends of A< N > if N <= M. but it doesn't
compile :^(
why?
thx,
Oliver
following code will not compile with MS VC 7.1:
struct null_type;
template< bool B, typename T, typename E >
struct if_then_else;
template< typename T, typename E >
struct if_then_else< true, T, E >
{
typedef T result_type;
};
template< typename T, typename E >
struct if_then_else< false T, E >
{
typedef E result_type;
};
template< int N >
class A
{
private:
template< int M >
class X
{
typedef typename if_then_else< N <= M, A< M >, null_type >::result_type
result_type;
};
template< int M >
friend typename A< N >::X< M >::result_type;
//friend typename A::X< M >::result_type;
};
only such A< M > should become friends of A< N > if N <= M. but it doesn't
compile :^(
why?
thx,
Oliver