M
Mikhail N. Kupchik
Hi All.
I have a question regarding C++ programming language standard. It
is related to standard library, not to the core language.
Is it portable to instantiate template class std::list<> with
incomplete type? I've seen some STL implementations which allow this
and some others that does not. I did not find any mentioning of this
topic in the standard, maybe I searched not enough thoroughly?
It would be useful, for example, in such real code:
----------------------------------------------------------------
class TermArg;
class Term
{
...
std::list< TermArg > args_;
};
class TermArg
{
...
Term term_;
};
----------------------------------------------------------------
But is it portable to any standard-compliant STL implementation?
Same question for other STL template container classes.
-- Mikhail Kupchik
I have a question regarding C++ programming language standard. It
is related to standard library, not to the core language.
Is it portable to instantiate template class std::list<> with
incomplete type? I've seen some STL implementations which allow this
and some others that does not. I did not find any mentioning of this
topic in the standard, maybe I searched not enough thoroughly?
It would be useful, for example, in such real code:
----------------------------------------------------------------
class TermArg;
class Term
{
...
std::list< TermArg > args_;
};
class TermArg
{
...
Term term_;
};
----------------------------------------------------------------
But is it portable to any standard-compliant STL implementation?
Same question for other STL template container classes.
-- Mikhail Kupchik