Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 04, 2007 bug: strange namespace bug | ||||
---|---|---|---|---|
| ||||
Attachments: | This has come up in the development of a new library - flecxx; zero-cost flexibility for standard libraries - that I'm hoping to 0.1-launch this month. DMC++ is the only compiler that has any kind of problems with what I'm trying to do. Hopefully the bug is something very simple, and a fix can be effected reasonably quickly. The problem manifests even with one level of namespace (dmc_ns_bug_small.cpp); I've submitted both because it's imperative for flecxx that the two-level one (dmc_ns_bug.cpp) works. Compilation of the "small" version gives: P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(221) : Error: namespace 'ns1' does not enclose member '?0' of namespace 'std' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(222) : Error: undefined identifier 'ios_base' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(228) : Error: namespace 'ns1' does not enclose member '?0' of namespace 'std' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(231) : Error: namespace 'ns1' does not enclose member '?1' of namespace 'std' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(233) : Error: namespace 'ns1' does not enclose member '?B_N' of namespace 'std ' Fatal error: too many errors --- errorlevel 1 Compilation of the two-level version gives: P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(221) : Error: namespace 'ns2' does not enclose member '?0' of namespace 'std' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(222) : Error: undefined identifier 'ios_base' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(228) : Error: namespace 'ns2' does not enclose member '?0' of namespace 'std' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(231) : Error: namespace 'ns2' does not enclose member '?1' of namespace 'std' P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(233) : Error: namespace 'ns2' does not enclose member '?B_N' of namespace 'std ' Fatal error: too many errors --- errorlevel 1 Cheers Matt |
December 02, 2007 Re: bug: strange namespace bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | I had a similar problem. The only solution I found, was to declare the class that used the std::* outside the namespace, then inherit or typedef it inside the namespace, for example: #include <fstream> template< typename C, typename T > class basic_fstream_outside : public ::std::basic_fstream<C, T>{}; namespace ns1 { template< typename C , typename T > class basic_fstream : public ::basic_fstream_outside<C, T> {}; typedef ::ns1::basic_fstream<char, ::std::char_traits<char> > fstream; } // namespace ns1 void main() { ns1::fstream stm; } ___________________________ I didn't test this out with fstream, rather the problem occurred with std::map. std::string did not have this problem. |
December 25, 2007 Re: strange namespace bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Wilson | Any news on this? I'm about to launch flecxx in next week or so, and it'd be nice not to have to #error on DMC++ for some of the components. Cheers Matt "Matthew Wilson" <matthew@hat.stlsoft.dot.org> wrote in message news:fgl6jq$2mia$1@digitalmars.com... > This has come up in the development of a new library - flecxx; zero-cost flexibility for standard libraries - that I'm hoping to 0.1-launch this month. DMC++ is the only compiler that has any kind of problems with what I'm trying to do. Hopefully the bug is something very simple, and a fix can > be effected reasonably quickly. > > The problem manifests even with one level of namespace > (dmc_ns_bug_small.cpp); I've submitted both because it's imperative for > flecxx that the two-level one (dmc_ns_bug.cpp) works. > > Compilation of the "small" version gives: > > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(221) > : Error: namespace 'ns1' does not enclose member '?0' of namespace 'std' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(222) > : Error: undefined identifier 'ios_base' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(228) > : Error: namespace 'ns1' does not enclose member '?0' of namespace 'std' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(231) > : Error: namespace 'ns1' does not enclose member '?1' of namespace 'std' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(233) > : Error: namespace 'ns1' does not enclose member '?B_N' of namespace 'std > ' > Fatal error: too many errors > --- errorlevel 1 > > Compilation of the two-level version gives: > > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(221) > : Error: namespace 'ns2' does not enclose member '?0' of namespace 'std' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(222) > : Error: undefined identifier 'ios_base' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(228) > : Error: namespace 'ns2' does not enclose member '?0' of namespace 'std' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(231) > : Error: namespace 'ns2' does not enclose member '?1' of namespace 'std' > P:\Programs\dm\Libraries\STL\STLport-4.5\stlport\stlport\stl/_istream.h(233) > : Error: namespace 'ns2' does not enclose member '?B_N' of namespace 'std > ' > Fatal error: too many errors > --- errorlevel 1 > > > Cheers > > Matt > > > |
Copyright © 1999-2021 by the D Language Foundation