-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWC: make Dummy function placeholders callable to fix build with MSVC #361
MWC: make Dummy function placeholders callable to fix build with MSVC #361
Conversation
a692a41
to
49fe8ab
Compare
Why was MSVC fixed by making these types callable? I'm a little concerned we're taking a PoD type and unmaking it PoD. |
@hallfox added an explanation for this to the title of the PR |
I'll review this. |
Template code is not instantiated unless used explicitly, which I believe is the reason this code compiles perfectly in GCC/Clang. MSVC might by buggy. Does |
src/groups/mwc/mwcex/mwcex_future.h
Outdated
@@ -232,7 +232,7 @@ class Future_Exception { | |||
|
|||
/// Provides a "small" dummy object which size is used to calculate the | |||
/// size of the on-stack buffer used for optimization. | |||
struct Dummy { | |||
struct Dummy : public mwcu::NoOp { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda get the rational behind changes in mwcex_job
-- the Dummy
is involved with a functor, but what is the rational here? Does the code not compile if you leave this dummy (and the one below) as is?
Side note. Evgenii, while you're at it, might as well replace usage of |
.gitignore
Outdated
src/applications/bmqbrkr/etc/etc | ||
|
||
# 'sim_cpp11_features.pl' backups | ||
src/groups/mwc/mwcex/mwcex_bindutil.h.bak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be simpler to remove those backup files in that same script that calls sim_cpp11_features.pl? That way we won't have to edit this file each time a component is added or removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have access to the script that launches the sim_cpp11_features.pl
, since it's done within bde-tools
. I updated .gitignore
with wildcard backup pattern which covers all the changes, and this is the simplest way.
a0ab9a1
to
a79202a
Compare
Evgenii, since you decided to replace And DO NOT remove the |
I already checked that no other libraries depend on |
Okay, It that case we are good to remove it. |
Also note than, unlike |
a79202a
to
408e51b
Compare
This is a good point. We might save a few ticks in some places.
Moved out
We can get Windows support for For
No strict requirements. On this stage, it's worth it to solve problems once they occur, until we have a better vision. |
How do you check the code compiles on Windows. Which compiler do you use? Can you use a newer compiler? |
I have a configured Windows preset which I can build. Also, I use the latest MSVC compiler available:
If I roll back the proposed changes, I will get errors from the compiler:
|
There is a question left unanswered -- what is the rational behind changes in |
It doesn't |
I assume this is because |
No If I remove inheritance from
And regarding the
I found out that it's not necessary to inherit
|
6bb9494
to
e3d059c
Compare
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
e3d059c
to
b54ff5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
…bloomberg#361) Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
…bloomberg#361) Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
…bloomberg#361) Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
Simpler to observe what's going on in this source: https://github.com/bloomberg/blazingmq/blob/49fe8ab987bdaeef1298bb16538b373922b8d73f/src/groups/mwc/mwcex/mwcex_job.h
Note that in the code we instantiate some template classes with
Dummy
objects, like this:We don't actually use these
Job_Target<Dummy>
objects, but let's look closely what do we want to instantiate:Here:
blazingmq/src/groups/mwc/mwcex/mwcex_job.h
Lines 217 to 222 in 49fe8ab
So basically in this code we are trying to "call" a
Dummy
structure here: bslmf::Util::moveIfSupported(d_function.object())();I am curious why it even compiled before.
Note that we already have this fix in some, but not all the places where it's needed. For example, here:
blazingmq/src/groups/mwc/mwcu/mwcu_operationchain.h
Lines 390 to 392 in 7f817c4
UPD: for executor it's even more complicated, since we have to implement the common interface of
Executor_TargetBase
which is expected as a template parameter.