boostorg / bimap

Boost.org bimap module
http://boost.org/libs/bimap
19 stars 48 forks source link

End of line comments in BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP macro call in set_of.hpp #37

Open pauljansen42 opened 1 year ago

pauljansen42 commented 1 year ago

There is a macro call

BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP(

    // binds to
    multi_index::ordered_unique,

    // with
    key_compare
)

in the file boost/bimap/set_of.hpp. There is nothing wrong with that. However, if you run this in preprocess only mode for Visual Studio (which we need as input for our code checkers), it will end up in incorrect code:

// binds to// withtemplate< class KeyExtractor, class Tag > struct index_bind { typedef multi_index::ordered_unique < multi_index::tag< Tag >, KeyExtractor, key_compare > type; };

I know that this is a bug in Visual Studio, but it help if you can change it into

BOOST_BIMAP_GENERATE_INDEX_BINDER_1CP(

    /* binds to */
    multi_index::ordered_unique,

    /* with */
    key_compare
)

i.e. changing // comments into / .. / comments twice. Many thanks for your help.

For my own reference this is TiCS ticket 21934.