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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:56:59+00:00 2026-06-04T13:56:59+00:00

For this non-variadic example: int Func1(); double Func2(); void MyFunc( int, double ); int

  • 0

For this non-variadic example:

int     Func1();
double  Func2();
void    MyFunc( int, double );

int  main()
{
    MyFunc( Func1(), Func2() );
    //...
}

it’s not specified whether Func1() or Func2() is computed first, just that both must be done before MyFunc() is called.

How does this sequencing work with the expansion of variadic arguments?

template < typename Func, typename ...Args >
void  MyFunc2( Func &&f, Args&& ...a )
{
    int  b[] = { f( std::forward<Args>(a) )... };
    //...
}

Let’s say that f is a function object that changes its state after its first call. Will f be called in order for each segment of a? In other words, will f be called on the first item in a‘s list, then the second item, the third, etc., instead of randomly skipping through the expanded list? Is there what we used to call sequence points between each item?

  • 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-06-04T13:57:01+00:00Added an answer on June 4, 2026 at 1:57 pm

    Yes, brace enclosed initializer lists guarantee an evaluation order of left-to-right, while function calls do not. So MyFunc2 will sequence correctly.

    The Wikipedia article covers this: https://en.wikipedia.org/wiki/Variadic_templates

    Is there what we used to call sequence points between each item?

    No, while it uses a comma token it is not the comma operator.

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

Sidebar

Related Questions

I'm not sure if this is possible (complete non-flash developer speaking), but we have
I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
I have a window with 3 radiobuttons like this(removed all non interesting props): <Control
This is actually a non-critical question, but I get this warning most of the
This likely applies to non MVC too. But, Is it possible to use the
This is probably a stupid question, but what exactly is a non-blocking web server?
I have this href link with text either attivo or non attivo User can
I have added this rule in my web.config to redirect non www URLs to
I want to build a 2 dimensional (non ragged at this point) object array.
C++0x thread library or Boost.thread define non-member variadic template function that lock all lock

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.