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

  • Home
  • SEARCH
  • 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
  • 0 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

Ask A Question

Stats

  • Questions 540k
  • Answers 540k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Sorts the given array in-place. You are aware of std::sort… May 17, 2026 at 2:34 am
  • Editorial Team
    Editorial Team added an answer A trigger is a better solution. As of version 9.0… May 17, 2026 at 2:33 am
  • Editorial Team
    Editorial Team added an answer The most effective way is to know the location of… May 17, 2026 at 2:33 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I've tried using LaTeX and DocBook for documenting programming tools, to get PDF output.
So I have basically started documenting a class library I made, this is the
We have a web application which has been developed over the past 7 months.
When writing GUI apps I use a top level class that controls or coordinates
Its been a while I have ready Mcconnell's Code Complete . Now I read
This piece of code compiles and runs as expected on GCC 3.x and 4.x:
I'm a relatively newbie to object oriented programming in JavaScript, and I'm unsure of
I'm going to develop a firefox extension which makes an XMLHttpRequest to this WebService.
I am writing a short and simple profiler (in C), which is intended to
I have some XML that looks something like this: <Root> <Documents> <Document id=1/> </Documents>

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.