Boost logo

Boost-Commit :

From: pbristow_at_[hidden]
Date: 2007-06-26 09:42:31


Author: pbristow
Date: 2007-06-26 09:42:30 EDT (Tue, 26 Jun 2007)
New Revision: 7169
URL: http://svn.boost.org/trac/boost/changeset/7169

Log:
Control of compile options via macro - to be superseded by policy

Text files modified:
   sandbox/math_toolkit/boost/math/distributions/cauchy.hpp | 14 +++++++++++---
   1 files changed, 11 insertions(+), 3 deletions(-)

Modified: sandbox/math_toolkit/boost/math/distributions/cauchy.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/cauchy.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/cauchy.hpp 2007-06-26 09:42:30 EDT (Tue, 26 Jun 2007)
@@ -1,4 +1,6 @@
 // Copyright John Maddock 2006.
+// Copyright Paul A. Bristow 2007.
+
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -124,7 +126,7 @@
    return complement ? loc - result : loc + result;
 } // quantile
 
-}
+} // namespace detail
 
 template <class RealType = double>
 class cauchy_distribution
@@ -210,8 +212,14 @@
 
 template <class RealType>
 inline RealType mean(const cauchy_distribution<RealType>& )
-{
- // There is no mean:
+{ // There is no mean:
+#ifdef BOOST_MATH_COMPILE_FAIL_IF_UNDEFINED
+# ifdef BOOST_MSVC
+# error Mean of the Cauchy distribution is undefined!
+# else
+ BOOST_STATIC_ASSERT(sizeof(RealType) == 0);
+# endif
+#endif
    return tools::domain_error<RealType>(
       BOOST_CURRENT_FUNCTION,
       "The Cauchy distribution does not have a mean: "


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk