Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81382 - trunk/libs/random/src
From: marshall_at_[hidden]
Date: 2012-11-17 03:05:20


Author: marshall
Date: 2012-11-17 03:05:20 EST (Sat, 17 Nov 2012)
New Revision: 81382
URL: http://svn.boost.org/trac/boost/changeset/81382

Log:
Replaced throw with boost::throw_exception; Refs #5399
Text files modified:
   trunk/libs/random/src/random_device.cpp | 9 +++++----
   1 files changed, 5 insertions(+), 4 deletions(-)

Modified: trunk/libs/random/src/random_device.cpp
==============================================================================
--- trunk/libs/random/src/random_device.cpp (original)
+++ trunk/libs/random/src/random_device.cpp 2012-11-17 03:05:20 EST (Sat, 17 Nov 2012)
@@ -14,6 +14,7 @@
 
 #include <boost/random/random_device.hpp>
 #include <boost/config.hpp>
+#include <boost/throw_exception.hpp>
 #include <boost/assert.hpp>
 #include <boost/detail/workaround.hpp>
 #include <string>
@@ -113,9 +114,9 @@
       sizeof(buf),
       NULL);
 
- throw std::invalid_argument("boost::random_device: " + msg +
+ boost::throw_exception(std::invalid_argument("boost::random_device: " + msg +
                                 " Cryptopraphic Service Provider " + provider +
- ": " + std::string(&buf[0], &buf[0] + num));
+ ": " + std::string(&buf[0], &buf[0] + num)));
   }
   const std::string provider;
   HCRYPTPROV hProv;
@@ -183,9 +184,9 @@
 
 private:
   void error(const std::string & msg) {
- throw std::invalid_argument("boost::random_device: " + msg +
+ boost::throw_exception(std::invalid_argument("boost::random_device: " + msg +
                                 " random-number pseudo-device " + path +
- ": " + strerror(errno));
+ ": " + strerror(errno)));
   }
   const std::string path;
   int fd;


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