www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - [STLSoft] method properties, or, "With a Little Help from My Friends"

reply Martin Moene <moene eld.physics.LeidenUniv.nl> writes:
Hi Matthew,

When I was trying out a (get) method property, it took me some time to find out 
that the errors I got are caused by the (lack of) capability of the compiler 
used (VC6 and GCC 3.4.2).

To make a long story short, I think it would be helpful if compilers that 
cannot use and therefore do not define
    STLSOFT_METHOD_PROPERTY_SET_EXTERNAL_PROP
    STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL_PROP

would report that fact via a #error, for example as in

    #else /* ? STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT */
=> # error Compiler is not compatible with method set properties
    #endif /* STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT */

With an emphasis on *set*.

By the looks of stlsoft/properties/method_properties.hpp, it seems there are 
compilers whithout STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT capability 
that can support STLSOFT_METHOD_PROPERTY_GET_EXTERNAL_PROP but VC6 and GCC 
3.4.2 seem not to be one of these. Unfortunately VC6 or GCC 3.4.2 do not report 
an error that explains this incapability when compiling such a get method. So 
may be STLSoft can provide some help here too?

Cheers,

Martin.
Jun 14 2008
parent Martin Moene <moene eld.physics.LeidenUniv.nl> writes:
Martin Moene wrote:
 Hi Matthew,
 
 When I was trying out a (get) method property, it took me some time to 
 find out that the errors I got are caused by the (lack of) capability of 
 the compiler used (VC6 and GCC 3.4.2).
 
 To make a long story short, I think it would be helpful if compilers 
 that cannot use and therefore do not define
    STLSOFT_METHOD_PROPERTY_SET_EXTERNAL_PROP
    STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL_PROP
 
 would report that fact via a #error, for example as in
 
    #else /* ? STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT */
 => # error Compiler is not compatible with method set properties
    #endif /* STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT */
 
 With an emphasis on *set*.

Well, using #error as shown above, also inhibits use of a property get method (STLSOFT_METHOD_PROPERTY_GET_EXTERNAL) where its use would be possible. Not a good idea... The error should occur when we /use/ the property set method when the compiler cannot provide us with that. However just expanding to #error is not possible: # define STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL(RG, RS, C, GM, SM, P) \ #error Error: Compiler is not compatible with method set properties. Maybe the following is a possible solution? # define STLSOFT_METHOD_PROPERTY_GETSET_EXTERNAL(RG, RS, C, GM, SM, P) \ Error_Compiler_is_not_compatible_with_method_set_properties which yields an undeclared identifier error. Cheers, Martin.
 
 By the looks of stlsoft/properties/method_properties.hpp, it seems there 
 are compilers whithout STLSOFT_CF_MEM_FUNC_AS_TEMPLATE_PARAM_SUPPORT 
 capability that can support STLSOFT_METHOD_PROPERTY_GET_EXTERNAL_PROP 
 but VC6 and GCC 3.4.2 seem not to be one of these. Unfortunately VC6 or 
 GCC 3.4.2 do not report an error that explains this incapability when 
 compiling such a get method. So may be STLSoft can provide some help 
 here too?
 
 Cheers,
 
 Martin.

Jun 15 2008