fix bugs caught by clang++

This commit is contained in:
Daniel Larimer 2012-10-26 01:11:35 -04:00
parent 2ba214819e
commit 4f146b93f1
5 changed files with 9 additions and 7 deletions

View file

@ -9,7 +9,7 @@
namespace fc {
class abstract_thread;
class void_t;
struct void_t;
class priority;
class exception_ptr;
class thread;

View file

@ -191,7 +191,7 @@ namespace fc {
template<typename T>
value::value( T&& v ) {
new (holder) detail::value_holder();
fc::pack( *this, std::forward<T>(v) );
fc::pack( *this, fc::forward<T>(v) );
}
}

View file

@ -7,6 +7,9 @@
#include <fc/tuple.hpp>
namespace fc {
template<typename T>
T value_cast( const value& v );
struct void_t{};
template<typename T>
@ -160,7 +163,7 @@ namespace fc {
template<typename T>
static inline void unpack( const fc::value& jsv, T& v ) {
if( strcmp( jsv.type(), "string" ) == 0 ) {
v = fc::reflector<T>::from_string( value_cast<fc::string>(jsv).c_str() );
v = fc::reflector<T>::from_string( fc::value_cast<fc::string>(jsv).c_str() );
} else {
// throw if invalid int, by attempting to convert to string
fc::reflector<T>::to_string( v = value_cast<int64_t>(jsv) );
@ -269,7 +272,6 @@ namespace fc {
}
template<typename A, typename B, typename C, typename D>
inline void unpack( const fc::value& val, tuple<A,B,C,D>& t ) {
val = fc::value::array( tuple<A,B,C,D>::size );
t.visit( tuple_from_value_visitor(val) );
}

View file

@ -298,7 +298,7 @@ namespace fc {
this->reserve( this->size()+1 );
loc = this->begin() + pos;
if( this->size() != 0 ) {
new (this->end()) T( fc::move(this->back()) );
new ((void*)this->end()) T( fc::move(this->back()) );
auto cur = this->back();
++this->_data->size;
while( cur != loc ) {

View file

@ -5,8 +5,8 @@
#else
namespace fc {
template<typename T> class vector;
template<typename T> class reflector;
template<typename T> class reflector< fc::vector<T> >;
template<typename T> struct reflector;
template<typename T> struct reflector< fc::vector<T> >;
};
#endif