ABF: load and save std::pair.
[fail.git] / abf / stl_types.h
blob3718dea0a13ea349840e10d9289d6becac52e431
1 #ifndef AWFUL_ABF_STL_TYPES_H
2 #define AWFUL_ABF_STL_TYPES_H
4 namespace awful { namespace abf { namespace Impl
6 template< typename C1, typename C2, typename T1, typename T2 >
7 struct TypeMarshaler< DyadicType< C1, C2 >, std::pair< T1, T2 > >
9 typedef std::pair< T1, T2 > type;
11 template< class WCT > static void write( WCT& wct_, const type& val_ )
13 typedef TypeMarshaler< C1, T1 > tm1;
14 tm1::write( wct_, val_.first );
16 typedef TypeMarshaler< C2, T2 > tm2;
17 tm2::write( wct_, val_.second );
20 template< class RCT > static void read( RCT& rct_, type& val_ )
22 typedef TypeMarshaler< C1, T1 > tm1;
23 tm1::read( rct_, val_.first );
25 typedef TypeMarshaler< C2, T2 > tm2;
26 tm2::read( rct_, val_.second );
29 }}}
31 #endif