Hi, so after a weekend of thinking about this issue, i am still not much nearer to an solution. Everything begins with that i want to automatically adapt a structure to the needs of my library. which is: 1. it is fusion compatible such that it's elements form a fusion seqeunce(easy) 2. there exist a container type storing the structure such, that for every element of structure a container exists (also easy). 3. These containers now shall also be a fusion sequence (aparently hard). Th idea is, that one an algorithm can decide to only work on a small fraction of the heterogenous data having a nice memory layout at the same time. This is my approach which failed: //slightly simplified example struct SomeStruct{ int a; float b; }; //specialisation for my interface. Will be a macro. template<> struct SequenceType<SomeStruct>{//sequence type of the structure i want to create struct type: boost::fusion::sequence_facade< type, boost::fusion::random_access_traversal_tag
{ //create fusion sequence interface BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL(type, (std::vector<int>,a)(std::vector<float>b))
//sequence interface
typedef SomeStruct value_type;
struct reference{...};//reference to an element
struct const_reference{...};
typedef ProxyIterator
thanks for the reply. Is it possible to just copy and rename the macro, or does it depend on newer features of fusion? I need to be compatible with boost 1.45 so i can't use it directly (also i need to add a few more functions to the structure later on)
BOOST_FUSION_DEFINE_STRUCT_INLINE is implemented using the sequence_facade and iterator_facade extension mechanisms, which were present in Boost 1.45 [1] [2]. So, it should be straightforward to back-port the macro to 1.45.
Regards, Nate
[1]
http://www.boost.org/doc/libs/1_45_0/libs/fusion/doc/html/fusion/extension/s... [2]
http://www.boost.org/doc/libs/1_45_0/libs/fusion/doc/html/fusion/extension/i...
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users