Mirror reflection library 0.5.13

mirror/example/various_04.cpp

This example shows the usage of Mirrors intrinsic meta-functions

More preciselly this example shows the usage of the reflection templates, inheritance reflection, intrinsic meta-functions and meta-programming tools.

Copyright 2008-2011 Matus Chochlik. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <mirror/mirror.hpp>
#include <iostream>
#include "./classes.hpp"

int main(void)
{
    using namespace mirror;
    //
    // print the inheritance type specifier for
    // for the first base of the test::F class
    std::cout <<
        inheritance_type<
            mp::at_c<
                base_classes<
                    reflected<test::F>
                >,
                1
            >
        >::type::keyword()
    << std::endl;
    // now print the full name of that base class
    std::cout <<
        base_class<
            mp::at_c<
                base_classes<
                    reflected<test::F>
                >,
                1
            >
        >::type::full_name()
    << std::endl;
    //
    return 0;
}

/* Example of output:
*/

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.