Boost logo

Boost :

From: Boris Gubenko (Boris.Gubenko_at_[hidden])
Date: 2006-06-20 17:35:32


In date_time/string_parse_tree.hpp, there is the following code:

template<typename charT>
struct string_parse_tree
{
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x581) )
  typedef std::multimap<charT, string_parse_tree< charT> > ptree_coll;
#else
  typedef std::multimap<charT, string_parse_tree > ptree_coll;
#endif
...
  ptree_coll m_next_chars;
...
};

This code instantiates STL container on an incomplete type. According
to section 17.4.3.6 of the C++ Standard, the implementation does not
have to support this.

The Rogue Wave library v2.2 and higher does not allow this for
associative containers (it does allow this for sequences). For example,
compiling a tiny program below on HP-UX results in an "incomplete type
is not allowed" error. This is what breaks date_time library tests on
HP-UX.

The Rogue Wave library v2.0, which is the C++ standard library on
Tru64, allows this, as well as gnu libstdc++, Dinkumware library and
STLport. It may explain why this issue has not been noticed before.

Boris Gubenko

---%<---
#include <map>

struct string_parse_tree
{
  typedef std::multimap<char, string_parse_tree> ptree_coll;
  ptree_coll m_next_chars;
};

string_parse_tree x;
--->%---


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