class placeholder
{
public: // structors
-
+
virtual ~placeholder()
{
}
virtual const std::type_info & type() const = 0;
virtual placeholder * clone() const = 0;
-
+
};
template<typename ValueType>
// #define BOOST_DISABLE_WIN32
+#define BOOST_NO_EXCEPTIONS 1
+#define BOOST_NO_WREGEX 1
+#define BOOST_NO_WSTRING 1
+
+#ifdef BOOST_NO_EXCEPTIONS
+//
+// If there are no exceptions then we must report critical-errors
+// the only way we know how; by terminating.
+//
+#ifdef __BORLANDC__
+// <cstdio> seems not to make stderr usable with Borland:
+#include <stdio.h>
+#endif
+# define BOOST_NOEH_ASSERT(x)\
+if(0 == (x))\
+{\
+ std::fprintf(stderr, "Error: critical boost failure in \"%s\"", #x);\
+ std::abort();\
+}
+#else
+//
+// With exceptions then error handling is taken care of and
+// there is no need for these checks:
+//
+# define BOOST_NOEH_ASSERT(x)
+#endif
#ifdef BOOST_HAS_THREADS
mutex_type::scoped_lock lock(mtx_);
#endif
+#ifndef BOOST_NO_EXCEPTIONS
if(use_count_ == 0 && weak_count_ != 0) throw use_count_is_zero();
+#endif
+ BOOST_NOEH_ASSERT(!(use_count_ == 0 && weak_count_ != 0));
++use_count_;
++weak_count_;
}
catch(...)
{
d(p); // delete p
+#ifndef BOOST_NO_EXCEPTIONS
throw;
+#endif
+ BOOST_NOEH_ASSERT(false);
}
}
r.release();
}
-#endif
+#endif
~shared_count() // nothrow
{