syntax suggestion

Alexander Nasonov <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
I'd like to see inheritance more natural in langbinding. What do you think
if inheritance relationships could be exposed like this:

class_<C>("C")
    , public_<A>
    , public_<B>
[
    // ...
];


// Implementation
namespace aux {

template<class Class> struct public_tag;

} // namespace aux

template<class Class>
void public_(aux::public_tag<Class>&) {}

template<class Class>
struct class_
{
    class_(char const* name) {}

    template<class T>
    class_ operator,(void (&)(aux::public_tag<T>&))
    {
        return *this;
    }
};


struct A {};
struct B {};
struct C : A, B {};

int main()
{
    class_<C>("C")
        , public_<A>
        , public_<B>;
}


-- 
Alexander Nasonov
Independent Developer and Consultant



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.