[C++-sig] Limit On No. Of Constructors?

Scott A. Smith ssmith at magnet.fsu.edu
Thu Nov 14 03:11:12 CET 2002

Is there a limit on the number of constructors allowed
for a single class?

I have several defined for one of my classes:

//                                The Class

  class_<SinglePar>("SinglePar", init<>())

//                              Constructors

    .def(init<const SinglePar&>())
    .def(init<const std::string&, int, const std::string&, const
    .def(init<const std::string&, int,                     const
    .def(init<const std::string&, double,                  const
    .def(init<const std::string&, const std::string&,      const
    .def(init<const std::string&>())

and during compilation (MSVC 6) this will produce the error
C:\PROGRAM FILES\BOOST\BOOST_1_29_0\boost/type_traits/is_arithmetic.hpp(38)
: fatal error C1204: compiler limit : internal structure overflow
FILES\BOOST\BOOST_1_29_0\boost/type_traits/is_scalar.hpp(30) : see reference
to class template instantiation 'boost::is_arithmetic<class ParameterSet
const >' being compiled .......

Microsoft has provided no documentation as to what C1204 means. But if I
comment out one or two of
the above constructors, then the build works with out problems. It does not
seem to matter which
of them I comment out, other than I need only comment out 1 if I choose the
2nd or 5th overload
above, but I need to comment out two if stopping use of any of the others.

If there are no intrinsic limits I'll keep looking and try to make a simple
example of how
this failure occurs. The actual errors produced always reference classes
deeper in my module,
perhaps this indicates it is not a problem with BP but with some other code,
but it is quite
odd that the build errors disappear when I declare fewer constructors (but
not any one of them
in particular).


More information about the Cplusplus-sig mailing list