
In C++ it is possible to determine whether there exists a member of a class of a specified type (including member functions) with a given name. As far as I know, there exists no such functionality in Boost. Why is this? It can easily be implemented as a traits class for a specific identifier/signature, which can then be made into a macro.

On Wed, Oct 8, 2008 at 22:15, coppro <coppro@users.sourceforge.net> wrote:
In C++ it is possible to determine whether there exists a member of a class of a specified type (including member functions) with a given name. As far as I know, there exists no such functionality in Boost. Why is this? It can easily be implemented as a traits class for a specific identifier/signature, which can then be made into a macro.
Sounds like BOOST_MPL_HAS_XXX_TRAIT_DEF : http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/has-xxx-trait-de... HTH, ~ Scott

Scott McMurray wrote:
Sounds like BOOST_MPL_HAS_XXX_TRAIT_DEF : http://www.boost.org/doc/libs/1_36_0/libs/mpl/doc/refmanual/has-xxx-trait-de...
HTH, ~ Scott
No, because that only detects member typedefs. It is possible to detect members of any type, for instance, whether there exists an int T.foo. Sean

On Wed, 08 Oct 2008 20:15:58 -0600, coppro <coppro@users.sourceforge.net> wrote:
In C++ it is possible to determine whether there exists a member of a class of a specified type (including member functions) with a given name. As far as I know, there exists no such functionality in Boost. Why is this? It can easily be implemented as a traits class for a specific identifier/signature, which can then be made into a macro.
Boost.MPL provides such a macro, although I believe it only detects nested types at the moment. Sebastian

coppro a écrit :
In C++ it is possible to determine whether there exists a member of a class of a specified type (including member functions) with a given name. As far as I know, there exists no such functionality in Boost. Why is this? It can easily be implemented as a traits class for a specific identifier/signature, which can then be made into a macro.
Well, it wasn't made because it was'nt made *pouts* There is a starting for this that have been satrted like today by Daniel Walker and myself.

Joel Falcou wrote:
coppro a écrit :
In C++ it is possible to determine whether there exists a member of a class of a specified type (including member functions) with a given name. As far as I know, there exists no such functionality in Boost. Why is this? It can easily be implemented as a traits class for a specific identifier/signature, which can then be made into a macro.
Well, it wasn't made because it was'nt made *pouts* There is a starting for this that have been satrted like today by Daniel Walker and myself.
Ah. I apologize. I had assumed that it was so simple that it would have to be in Boost, thus there would be some rationale for it not being. However, it looks like Joel Falcou has whipped something up while I complained about it, so props to him. Sean

On Thu, Oct 9, 2008 at 4:15 AM, coppro <coppro@users.sourceforge.net> wrote:
In C++ it is possible to determine whether there exists a member of a class of a specified type (including member functions) with a given name. As far as I know, there exists no such functionality in Boost. Why is this? It can easily be implemented as a traits class for a specific identifier/signature, which can then be made into a macro. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Hi, I'm not sure if it is exactly what you're looking for, but you can also take a look at the Mirror reflection library. You can find the most recent version in the boost sandbox svn repository at: http://svn.boost.org/svn/boost/sandbox/mirror/ a more stable version in the vault: http://www.boostpro.com/vault/ -- ________________ ::matus_chochlik

On Mon, Oct 13, 2008 at 9:27 AM, Matus Chochlik <chochlik@gmail.com> wrote:
Hi, I'm not sure if it is exactly what you're looking for, but you can also take a look at the Mirror reflection library. You can find the most recent version in the boost sandbox svn repository at:
http://svn.boost.org/svn/boost/sandbox/mirror/
a more stable version in the vault:
Is it planned to get it into review for acceptance/or not ? It looks quite interesting. -- Alp Mestan --- http://blog.mestan.fr/ --- http://alp.developpez.com/ --- In charge of the Qt, Algorithms and Artificial Intelligence sections on Developpez

On Mon, Oct 13, 2008 at 10:20 PM, Alp Mestan <alp@mestan.fr> wrote:
On Mon, Oct 13, 2008 at 9:27 AM, Matus Chochlik <chochlik@gmail.com> wrote:
Hi, I'm not sure if it is exactly what you're looking for, but you can also take a look at the Mirror reflection library. You can find the most recent version in the boost sandbox svn repository at:
http://svn.boost.org/svn/boost/sandbox/mirror/
a more stable version in the vault:
Is it planned to get it into review for acceptance/or not ?
Yep, the plan is to ask for a review when several minor things get fixed and the docs are finished. But currently I have some other projects that need a lot of attention, so I had to put Mirror on hold for a while. I'm hoping to have it review ready by the end of this year.
It looks quite interesting. Thanks ;)
Best regards, ________________ ::matus_chochlik
participants (7)
-
Alp Mestan
-
coppro
-
Joel Falcou
-
Matus Chochlik
-
Scott McMurray
-
Sean Hunt
-
wasti