removing duplicate definitions given boost::flat_map == boost::interprocess::flat_map
This commit is contained in:
parent
5c5156f3db
commit
ddc2c16cdb
1 changed files with 21 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
#include <boost/interprocess/containers/string.hpp>
|
#include <boost/interprocess/containers/string.hpp>
|
||||||
#include <boost/interprocess/containers/vector.hpp>
|
#include <boost/interprocess/containers/vector.hpp>
|
||||||
#include <boost/interprocess/containers/map.hpp>
|
#include <boost/interprocess/containers/map.hpp>
|
||||||
|
#include <boost/interprocess/containers/flat_map.hpp>
|
||||||
#include <boost/interprocess/containers/deque.hpp>
|
#include <boost/interprocess/containers/deque.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -33,6 +34,26 @@ namespace fc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* bip::flat_map == boost::flat_map
|
||||||
|
template<typename K, typename V, typename... T >
|
||||||
|
void to_variant( const bip::flat_map< K, V, T... >& var, fc::variant& vo ) {
|
||||||
|
std::vector< variant > vars(var.size());
|
||||||
|
size_t i = 0;
|
||||||
|
for( auto itr = var.begin(); itr != var.end(); ++itr, ++i )
|
||||||
|
vars[i] = fc::variant(*itr);
|
||||||
|
vo = vars;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename K, typename V, typename... A>
|
||||||
|
void from_variant( const variant& var, bip::flat_map<K, V, A...>& vo )
|
||||||
|
{
|
||||||
|
const variants& vars = var.get_array();
|
||||||
|
vo.clear();
|
||||||
|
for( auto itr = vars.begin(); itr != vars.end(); ++itr )
|
||||||
|
vo.insert( itr->as< std::pair<K,V> >() );
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
template<typename... T >
|
template<typename... T >
|
||||||
void to_variant( const bip::vector< T... >& t, fc::variant& v ) {
|
void to_variant( const bip::vector< T... >& t, fc::variant& v ) {
|
||||||
std::vector<variant> vars(t.size());
|
std::vector<variant> vars(t.size());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue