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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:19:42+00:00 2026-06-10T07:19:42+00:00

I have a code like this typedef void(_stdcall * MyProcessor)(int, int); void FunctionProcess (MyProcessor

  • 0

I have a code like this

typedef void(_stdcall * MyProcessor)(int, int);

void FunctionProcess (MyProcessor process){
    MyProcessor myCallback;
    myCallback = (process != NULL)? process:"<functionThatDoesNothing>";
    ...
}

If there won’t be any callback function in the argument, I’d like to assign some function to myCallback, which would do nothing (or little something), because afterwards, I’m calling this function in loop (and I’d like to avoid ‘if’ in the loop because of the pipeline flush). I’ve tried a no-op lambda with no success (incompatible).

Are there any functions like this? Are there any other possibilities? Thank you.

  • 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-10T07:19:43+00:00Added an answer on June 10, 2026 at 7:19 am

    Your logic is insane! If the if is correctly-predicted it will be nearly free. If the indirect jump is incorrectly predicted, it will be horrible. An if is much easier to predict than an indirect jump (only two possibilities, speculative execution is possible, there are more prediction slots on most CPUs). So there are pretty much no conceivable circumstances where this makes sense.

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

Sidebar

Related Questions

I have code like this: ... entry.KeyPressEvent += EntryKeyPressEvent; ... } void EntryKeyPressEvent(object o,
Suppose I have code something like this: #include boost/thread/mutex.hpp using boost::mutex; typedef mutex::scoped_lock lock;
I have a struct like this: typedef struct { int sizes[3]; float **vals[3]; //
I have this structure: typedef struct { int data[10]; } small_structure; and this code:
I have code like this: class MapIndex { private: typedef std::map<std::string, MapIndex*> Container; Container
I have never see a grammar in c++ like this before: typedef int (callback)(int);
I have the following code: typedef void VOID; int f(void); int g(VOID); which compiles
I have this snippet of code: template<typename... Args> class function_helper<void(Args...)>{ public: typedef void(*generic_function)(Args...); static
I have code like this in my view model: function ChatListViewModel(chats) { var self
I have code like this - (IBAction)onClick:(id)sender { NSThread *thread = [[NSThread alloc]initWithTarget:parser selector:@selector(adapter:)

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.