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 945515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:45:49+00:00 2026-05-15T22:45:49+00:00

To make my code more concise, can I do something like int f(int const

  • 0

To make my code more concise, can I do something like

int f(int const x, y, z), g(int const x, y, z);

to declare functions f and g which each take three int const arguments?

Edit:
Perhaps here is a better example:

int f(int const a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z);

How would that not be more concise and readable than putting int const before every letter?

  • 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-15T22:45:50+00:00Added an answer on May 15, 2026 at 10:45 pm

    Using Boost preprocessor, and considering you don’t care to describe the function arguments one by one (but isn’t that the point of your question), you can use the following trick :

    #include <boost/preprocessor/repetition/enum_params.hpp>
    
    int f( BOOST_PP_ENUM_PARAMS(26, int const arg) );
    

    But don’t forget that the whole idea of not taking the required time and space to describe function arguments is very dangerous.

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

Sidebar

Related Questions

I hate blocks. They are meant to make the code more concise, but I
I would like to make some of my code more monadic and to use
I'm wondering if its possible to make the following code more concise: $('#americasTrigger').hover( function
I've been trying to optimize my code to make it a little more concise
I'm trying to make my code more concise (i.e., less repeated code). I've gotten
To make my code more readable, I like to avoid names of objects that
I stumbled upon https://codereview.stackexchange.com/questions/10610/refactoring-javascript-into-pure-functions-to-make-code-more-readable-and-mainta and I don't understand the answer since the user uses
I am trying to make my code more clear using the include function of
2 short questions based on trying to make my code more efficient (I think
Currently, I'm building several arrays in Powershell, but to make the code more portable,

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.