Added boost concept checks.

This commit is contained in:
Jens Luedicke
2011-01-23 02:15:46 +01:00
parent 2540b8a890
commit d28ec4eeeb
2 changed files with 7 additions and 0 deletions

View File

@@ -19,6 +19,8 @@
#include <map> #include <map>
#include <string> #include <string>
#include <boost/concept/assert.hpp>
#include <boost/concept_check.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
//! //!
@@ -47,6 +49,7 @@ public:
//! //!
explicit attribute(T &object) explicit attribute(T &object)
: reference(object) { : reference(object) {
BOOST_CONCEPT_ASSERT((boost::Assignable<T>));
} }
//! //!

View File

@@ -16,6 +16,8 @@
#include <string> #include <string>
#include <boost/concept/assert.hpp>
#include <boost/concept_check.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
namespace string2type { namespace string2type {
@@ -25,6 +27,8 @@ namespace string2type {
//! //!
template<typename T> template<typename T>
T convert(const std::string &value) { T convert(const std::string &value) {
BOOST_CONCEPT_ASSERT((boost::Assignable<T>));
return boost::lexical_cast<T>(value); return boost::lexical_cast<T>(value);
} }