std::use_facet bug ?

Hi all,

Following code does not compile with sunstudio11 (Sun C++ 5.8 2005/10/13) although it should IMHO:

#include <locale>

int main()

{

std::locale lc("") ;

std::use_facet< std::numpunct<char> >(lc) ;

return 0 ;

}

Is this a bug?

[312 byte] By [tknapen] at [2007-11-26 9:01:01]
# 1
Try to use '-library=stlport4' flag. If you do not need to link your application with binaries linked with libCstd.2.1.1 using stlport is the best choice.I think std::use_facet<std::Facet>(std::locale) is missed in the libCstd.2.1.1.
Atanasyan at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks.Actually I encounter this problem when compiling the boost-filesystem library in the CVS HEAD.Can you point me to some more information to the '-library=stlport4' option, I can't find anything on this in the man pages nor on the web.
tknapen at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

Sun C++ contains two c++ std library implementations: libCstd and stlport. The first one is an old implementation. We recommend to use it if you need backward compatibility only. The stlport is closer to the c++ standard.

Have you read my blog http://blogs.sun.com/roller/page/sga dedicated to Boost and Sun C++? It contains patch for Boost 1.32. So if you do not need the latest version of Boost filesystem library you could try it.

Atanasyan at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4

Yes, I actually found out about your blog on the boost-ml some time ago. Good job you are doing there!

It's a pitty you are not working on the CVS HEAD. If you contribute patches to 1.32 you will also have to submit them to the CVS HEAD to make sure they will be included in the next release.

On the standard libraries: I suppose they are not compatible?

tknapen at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
The default libCstd and the optional libstlport are not compatible. They provide different definitions of the same public names. The entire program, including any libraries it uses, must all be compiled to use libCstd or all compiled to use libstlport.
clamage45 at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
You can open the RFE (Request for Enhancement) to have Sun Studio add support CVS HEAD. Use http://bugs.sun.com.Of course, Sun has no guarantee to impement it but that is a only way to get Sun attention on it. -Ngoc
NgocNguyen at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7

There is no need to file an RFE. We are already working on the latest BOOST, and are working to get ahead of the curve so that BOOST additions are tested using Sun Studio before going back into the source base.

See Simon's Blog at

http://blogs.sun.com/roller/page/sga?catname=%2FBoost

for a running commentary on BOOST support.

clamage45 at 2007-7-6 23:06:41 > top of Java-index,Development Tools,Solaris and Linux Development Tools...