ComputationalRadiationPhysics / contributing

:books: guidelines and styles to contribute to our projects
Creative Commons Attribution 4.0 International
6 stars 10 forks source link

Comments in macros #29

Closed theZiz closed 6 years ago

theZiz commented 6 years ago

The proposed way of commenting macros in chapter 8 will not work:

#define MY_MACRO( )                                                           \
    template<                                                                 \
        // typename T0, ..., typename TN                                      \
        BOOST_PP_ENUM_PARAMS( N, typename T )                                 \
    >                                                                         \
    HDINLINE                                                                  \
    void                                                                      \
    //         ( T0 const, ... , TN const           )                         \
    operator( )( BOOST_PP_ENUM_PARAMS( N, T const ) ) const

// will start a comment for the rest of the line. However as macros use \ the whole code above is just one line. So everything after // typename T0, ..., typename TN will be ignored. :wink: Even the github highlighting shows the behaviour! :laughing:

Which way of commenting should be favoured instead? Just plain old /* … */ ?

ax3l commented 6 years ago

Hm, I guess it's /* ... */ then ;)

Great we don't need much of BOOST_PP with variadics in C++11 anymore...

Feel free to open a PR!

theZiz commented 6 years ago

Will do so, but wanted to ask for the right™ way of commenting first. :wink:

ax3l commented 6 years ago

@psychocoderHPC agreed?

psychocoderHPC commented 6 years ago

ack

ax3l commented 6 years ago

@theZiz the stage is yours

theZiz commented 6 years ago

Hm, I thought I already made a PR, something went wrong...