
Zitat von Matus Chochlik <chochlik@gmail.com>:
On Mon, Jun 28, 2010 at 3:32 PM, Sohail Somani <sohail@taggedtype.net> wrote:
On 10-06-28 8:00 AM, Stefan Strasser wrote:
template<class Mapping> friend void introspect(Mapping mapping,type<A>){ mapping (base_class<A_base>() ) (member<A,int ,&A::m_a>() ) (member<A,float ,&A::m_b>() ) (member<A,std::vector<int>,&A::m_vec>()) (); }
I think a library like this would be useful.
Just FYI there is also another introspection/reflection library being developed for boost called Mirror. It can be downloaded from sourceforge here: http://sourceforge.net/projects/mirror-lib/files/ or from the boost vault.
I did look at Mirror as you know, however, AFAIU it does not fulfill my requirement of an easy-to-implement concept that can be used to implement no-overhead introspection algorithms. In case I got that wrong or in case that changes, I'd be happy to switch to Mirror for gaining access to the class members, as the focus of my library is on the algorithms, with introspection as a means to this end. The problem domain of "Intro" isn't really introspection/reflection, but algorithms using introspection.
For example Mirror currently does not cooperate well with Boost.Serialization, but this is one of the things on my TODO list.
Intro does not coorperate with Boost.Serialization but implements serialization on its own (although it is planned to fall back to the Serializable concept in case introspect() is not available.) Boost.Serialization has several implementation related issues but also problems that are by design (e.g. "track_selectively") that do not allow for optimal performance. see my performance comparison. Stefan