complex expression not allowed in dependent template argument expression
Hi,
trying to compile current Boost, I get $subject in a line that reads
(cf. http://engineering.meta-comm.com/boost-regression/CVS-HEAD/developer/output/mmu tz-bin-boost-libs-concept_check-where-test-sunpro-debug.html)
--begin excerpt--
// Here we implement the metafunction that detects whether a
// constraints metafunction exists
typedef char yes;
typedef char (&no)[2];
template <class Model, void (Model::*)()>
struct wrap_constraints {};
template <class Model>
inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints
>* = 0); // ### error here
inline no has_constraints_(...);
--end--
(this code is used to check for the existence of a constraints() member function in the template argument)
Neither Google nor any of the Forums here turn up anything when searching for the error message. Since the Boost regression tests indicate that this line isn't a problem for various MSVC/gcc compilers, might this be a SunPro bug? If so, is there a workaround?
Thanks,
Marc
[1143 byte] By [
Marc_Mutz] at [2007-11-26 8:54:05]

# 1
The short answer - try to use '-Qoption ccfe -complextmplexp' command line option. This option will be turned on by default in the next version of Sun C++ compiler. Also you strictly need to use -libarary=stlport4.
The long answer is more complicated. The most compatible (with Sun C++) version of Boost is 1.32. It can be completely compiled and almost all regression tests are passed. Look at my blog http://blogs.sun.com/roller/page/sga for additional information, patches etc. If you need to work with Boost 1.33 or upcoming Boost 1.34 you could use my patch for Boost 1.32 as a start point to modify Boost source code. For example you must use some command line options which are not turned on in the Boost Jamfile. We plan to integrate all necessary changes into Boost source code and work on some bugs in Sun C++ to make upcoming versions of Boost library compatible with our compiler.
# 2
Sorry, but I can't use stlport, since we depend on a 3rd-party library that is compiled with stdC. Or so I'm told. I'll give the -complextmplexp option a spin, though. Thanks for your work on patching up the compiler to work with boost. In case you're the one that made Boost.Variant work with the -02 patch, I'm indebted to you :) I'm trying to get the upcoming 1.34 release to work better with SS11 and stdC, since we want to get rid of our own TR1 wrappers.