Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 996089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:49:26+00:00 2026-05-16T06:49:26+00:00

I am documenting some code which uses meta-programming heavily, for example: template<rysq::type A, rysq::type

  • 0

I am documenting some code which uses meta-programming heavily, for example:

 template<rysq::type A, rysq::type B, rysq::type C, rysq::type D, class Transform>
 struct Kernel<meta::braket<A,B,C,D>, Transform,
               typename boost::enable_if<
                   quadrature<meta::braket<A,B,C,D>, Transform> >::type>
 : Eri <Transform> {

what is a good way to document such construct using doxygen?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:49:27+00:00Added an answer on May 16, 2026 at 6:49 am

    Use preprocessor macros. Here’s an example from the not-yet-official Boost.XInt library (presently queued for review for inclusion in Boost):

    #ifdef BOOST_XINT_DOXYGEN_IGNORE
        // The documentation should see a simplified version of the template
        // parameters.
        #define BOOST_XINT_INITIAL_APARAMS ...
        #define BOOST_XINT_CLASS_APARAMS ...
        #define BOOST_XINT_CLASS_BPARAMS other
        #define BOOST_XINT_APARAMS ...
        #define BOOST_XINT_BPARAMS other
    #else
        #define BOOST_XINT_INITIAL_APARAMS \
            class A0 = parameter::void_, \
            class A1 = parameter::void_, \
            class A2 = parameter::void_, \
            class A3 = parameter::void_, \
            class A4 = parameter::void_, \
            class A5 = parameter::void_
        #define BOOST_XINT_CLASS_APARAMS class A0, class A1, class A2, class A3, \
            class A4, class A5
        #define BOOST_XINT_APARAMS A0, A1, A2, A3, A4, A5
        #define BOOST_XINT_CLASS_BPARAMS class B0, class B1, class B2, class B3, \
            class B4, class B5
        #define BOOST_XINT_BPARAMS B0, B1, B2, B3, B4, B5
    #endif
    

    Use the #defined macro names instead of the template parameters, everywhere you need them, like so:

    /*! \brief The integer_t class template.
    
    This class implements the standard aribitrary-length %integer type.
    
    [...lots more documentation omitted...]
    */
    template<BOOST_XINT_INITIAL_APARAMS>
    class integer_t: virtual public detail::integer_t_data<BOOST_XINT_APARAMS>,
        public detail::nan_functions<detail::integer_t_data<BOOST_XINT_APARAMS>::
        NothrowType::value, // ...lots more base classes omitted...
    {
        // ...etcetera
    

    And put lines like these in the Doxyfile:

    PREDEFINED             = BOOST_XINT_DOXYGEN_IGNORE
    
    EXPAND_AS_DEFINED      = BOOST_XINT_INITIAL_APARAMS \
                             BOOST_XINT_CLASS_APARAMS \
                             BOOST_XINT_CLASS_BPARAMS \
                             BOOST_XINT_APARAMS \
                             BOOST_XINT_BPARAMS
    

    The result is that Doxygen sees either “…” or “other” for the template parameters, and the compiler sees the real ones. If you describe the template parameters in the documentation for the class itself, then the user of the library will only need to see them in the one place that he’s likely to look for them; they’ll be hidden everywhere else.

    As an additional advantage to this design, if you ever need to make changes to the template parameter lists, you only need to change them in the macro definitions and the functions that actually use the changed parameters. Everything else will adapt automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm documenting some code in C++ right now, and one of the methods I
Im looking into documenting the javascript code we develop and are looking for some
Using Nhibernate.Search at the moment. Some code for context: [Indexed] class foo { [DocumentId]
All the files in the code base I am documenting will always use the
My code : <div class=allegati-item> <div class=allegati-titolo>Download</div> <a class=allegati-link href=/documenti/DocumentoTest.pdf>Link1</a> <a class=allegati-link href=/documenti/DocumentoTest.pdf>Link2</a> </div>
I've tried using LaTeX and DocBook for documenting programming tools, to get PDF output.
I've got some C code from a 3rd party vendor (for an embedded platform)
I'm documenting code in Eclipse and have been using the /** followed by Enter
I am trying to begin using some sort of standard for documenting my PHP
I'm in the process of documenting some of my functions for an R package

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.