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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:50:47+00:00 2026-05-22T15:50:47+00:00

With the following macro: #define ASSERT_IF_TEMP(expr) static_assert(?, Is temporary!); What should I put for

  • 0

With the following macro:

#define ASSERT_IF_TEMP(expr) static_assert(?, "Is temporary!");

What should I put for question mark?

  • 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-22T15:50:48+00:00Added an answer on May 22, 2026 at 3:50 pm

    First we should clarify: What do you mean by “temporary”?

    Many people mean different things when they say temporary. Technically, int() is not a temporary, but most people will include them into their own meaning of that term. Technically, given std::string s;, then move(s) isn’t a temporary either, but you may want to treat it as one with your macro.

    The first kind of “temporaries” I mentioned above are really “prvalue expressions”. Those are the std::string("foo") or int() kind of things, but not the move(s) and also (for sure) not the s kind of things. The decltype operator yields a non-reference type for the first kind of “temporaries” I talked about above. For the second kind, move(s), which are xvalues, it will yield an rvalue reference. And for the “non-temporaries”, i.e the s cases, it will yield an lvalue reference.

    So to summarize, I will define three precise macros, and you can choose from them

    #define IS_LVALUE(...) std::is_lvalue_reference<decltype((__VA_ARGS__))>::value
    #define IS_XVALUE(...) std::is_rvalue_reference<decltype((__VA_ARGS__))>::value
    #define IS_PRVALUE(...) !std::is_reference<decltype((__VA_ARGS__))>::value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following macro: #define IF_TRACE_ENABLED(level) if (IsTraceEnabled(level)) The user code should look
Anyone can explain in details what the following macro does? #define write_XDATA(address,value) (((char *)0x010000)
Suppose I have the following macro: #define xxx(x) printf(%s\n,x); Now in certain files I
My problem is quite simple. I want the following macro #define PROXYPASS(name, param) \
The following macro is defined in our code: #define MSGMacro(obj, arg) MyPaymentClass obj(arg) Where
Consider the following macro definitions and invocation: #define x x[0] #define y(arg) arg y(x)
I have the following macro: #define FOREACH(decl, c) BOOST_FOREACH(decl, std::make_pair((c).begin(), (c).end())) (I am using
I've got the following Macro to define a new function following a special naming
I am trying to invoke the following macro in my .cpp file: #define IAP_ROM_LOCATION
I have confusion on following c code #define MACRO (xx) \ foo(xx) ... #ifdef

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.