Boost logo

Boost :

From: Mike Attili (yahoomail_at_[hidden])
Date: 2001-10-25 11:05:14


> From: John Maddock [mailto:John_Maddock_at_[hidden]]
> Subject: Re: [boost] Re: unit test framework

> And there is BOOST_NO_STD_DISTANCE to indicate non-conformance.
>
> - John Maddock

Thanks.
Is there a macro in the new config system that covers the following
MSVC and GCC idiosyncrasy? I've come across it while working on an
extension to the unit test framework. None of the config macros that
I know about seem to apply.

All of the qualified... statements in the example below fail on
MSVC 6 sp5 with:
  error C2027: use of undefined type 'example'
However, gcc 3.0.1 complains about both unqualified_func...
statements with the error:
  invalid use of undefined type 'class example'
BCB 5 and Comeau 4.2.45.2 in strict mode are happy with all
of them. If either qualified or unqualified worked on all, I'd
use it and I'd rather not just use BOOST_MSVC since it's an
issue with GCC, too.

   Mike Attili
   Amaxo, Inc.

================================
#include <string>

template<void (*function)()>
struct func_template { func_template() { function(); } };

template<int * i>
struct int_template { int_template() { int j = *i; }};

template<class T>
struct type_template { T t; };

class example
{
    typedef std::string my_string;
    type_template<example::my_string> qualified_type;
    type_template<my_string> unqualified_type;

    static int i;
    int_template<&example::i> qualified_pint;
    int_template<&i> unqualified_pint;

    static void func() { }
    func_template<&example::func> qualified_func_w_amp;
    func_template<&func> unqualified_func_w_amp;
    func_template<example::func> qualified_func_wo_amp;
    func_template<func> unqualified_func_wo_amp;
};
================================


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