Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2007-01-19 16:22:35

I commited the fix for 1358600 - lexical_cast & pure virtual functions
& VC 8 STL ( for VC++ only but later I
found that Intel 8.1 and Comeau online don't compile as well.

The problem appears in numeric_limits functions. In this usecase,
they return an abstract class by value. Although lexical_cast never
uses those functions, it seems that some compilers do more strick
checking than I thought they should.

For example,

class A
    virtual void foo() = 0;

template<class T>
struct limits
    static int const value = true;
    static T declared_only();

int main()

fails to compile on VC++ 8, Intel 8.1 and Comeau online at the point
of the declared_only declaration.

However, if I replace a body of A with a declaration (class A;),
those compilers don't complain anymore.
What is this, a compiler bug or my misunderstanding? I remember
that some freedom compiling template code is allowed (and therefore,
some compiler compiles while some others don't) but I don't know
where to search in the standard.

Alexander Nasonov
The wise man does at once what the fool does finally. -- Baltasar
Gracian --
This quote is generated by: 
	/usr/pkg/bin/curl -L         \
	  | sed -e 's/^document\.write(.//' -e 's/.);$/ --/'  \
	        -e 's/<[^>]*>//g' -e 's/^More quotes from //' \
	  | fmt | tee ~/.signature-quote

Boost list run by bdawes at, gregod at, cpdaniel at, john at