Operators in C++ what does (::Type*)0 meanWhat is the meaning of prepended double colon “::”?What are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?What are POD types in C++?The Definitive C++ Book Guide and ListWhat is the effect of extern “C” in C++?What is the “-->” operator in C++?What is move semantics?What is The Rule of Three?What are the basic rules and idioms for operator overloading?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?
How to make the Bass in SATB move more smoothly?
Shorten or merge multiple lines of `&> /dev/null &`
What could a self-sustaining lunar colony slowly lose that would ultimately prove fatal?
WordPress 5.2.1 deactivated my jQuery
What is the meaning of "<&3" and "done < file11 3< file22"
When playing Edgar Markov, what is the definition of a "Vampire spell"?
Why A=2 and B=1 in the call signs for Spirit and Opportunity?
Why was this character made Grand Maester?
What did the 'turbo' button actually do?
Are runways booked by airlines to land their planes?
Dealing with spaghetti codebase, manager asks for things I can't deliver
How did NASA Langley end up with the first 737?
便利な工具 what does な means
Why would a rational buyer offer to buy with no conditions precedent?
Can you output map values in visualforce inline using a string key?
Job Market: should one hide their (young) age?
Expected maximum number of unpaired socks
Is it legal to have an abortion in another state or abroad?
Why did Drogon spare this character?
Where is Jon going?
I know that there is a preselected candidate for a position to be filled at my department. What should I do?
What's difference between "depends on" and "is blocked by" relations between issues in Jira next-gen board?
Do photons bend spacetime or not?
How to politely tell someone they did not hit "reply to all" in an email?
Operators in C++ what does (::Type*)0 mean
What is the meaning of prepended double colon “::”?What are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?What are POD types in C++?The Definitive C++ Book Guide and ListWhat is the effect of extern “C” in C++?What is the “-->” operator in C++?What is move semantics?What is The Rule of Three?What are the basic rules and idioms for operator overloading?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Can anyone tell me what this means?
(::Type*)0
actually it is part of this
return (is_modifytype()) ?
u.myfunction : (::Type*)0;
c++
add a comment |
Can anyone tell me what this means?
(::Type*)0
actually it is part of this
return (is_modifytype()) ?
u.myfunction : (::Type*)0;
c++
21
It means that this is old code that should be rewritten to usenullptr.
– Sam Varshavchik
8 hours ago
add a comment |
Can anyone tell me what this means?
(::Type*)0
actually it is part of this
return (is_modifytype()) ?
u.myfunction : (::Type*)0;
c++
Can anyone tell me what this means?
(::Type*)0
actually it is part of this
return (is_modifytype()) ?
u.myfunction : (::Type*)0;
c++
c++
edited 5 hours ago
Billal Ouali
asked 8 hours ago
Billal OualiBillal Ouali
403
403
21
It means that this is old code that should be rewritten to usenullptr.
– Sam Varshavchik
8 hours ago
add a comment |
21
It means that this is old code that should be rewritten to usenullptr.
– Sam Varshavchik
8 hours ago
21
21
It means that this is old code that should be rewritten to use
nullptr.– Sam Varshavchik
8 hours ago
It means that this is old code that should be rewritten to use
nullptr.– Sam Varshavchik
8 hours ago
add a comment |
1 Answer
1
active
oldest
votes
It means "cast the integer 0 (using a C-style cast) to the type Trip* (Trip pointer) found in the global namespace (::)".
It should just use nullptr - as in
return is_modifyCurrentTrip() ?
u.modifyCurrentTrip : nullptr;
Note: using :: explicitly to designate the global namespace prevents the compiler from prepending any namespace names itself - this is completely irrelevant when just using nullptr though.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f56259783%2foperators-in-c-what-does-type0-mean%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It means "cast the integer 0 (using a C-style cast) to the type Trip* (Trip pointer) found in the global namespace (::)".
It should just use nullptr - as in
return is_modifyCurrentTrip() ?
u.modifyCurrentTrip : nullptr;
Note: using :: explicitly to designate the global namespace prevents the compiler from prepending any namespace names itself - this is completely irrelevant when just using nullptr though.
add a comment |
It means "cast the integer 0 (using a C-style cast) to the type Trip* (Trip pointer) found in the global namespace (::)".
It should just use nullptr - as in
return is_modifyCurrentTrip() ?
u.modifyCurrentTrip : nullptr;
Note: using :: explicitly to designate the global namespace prevents the compiler from prepending any namespace names itself - this is completely irrelevant when just using nullptr though.
add a comment |
It means "cast the integer 0 (using a C-style cast) to the type Trip* (Trip pointer) found in the global namespace (::)".
It should just use nullptr - as in
return is_modifyCurrentTrip() ?
u.modifyCurrentTrip : nullptr;
Note: using :: explicitly to designate the global namespace prevents the compiler from prepending any namespace names itself - this is completely irrelevant when just using nullptr though.
It means "cast the integer 0 (using a C-style cast) to the type Trip* (Trip pointer) found in the global namespace (::)".
It should just use nullptr - as in
return is_modifyCurrentTrip() ?
u.modifyCurrentTrip : nullptr;
Note: using :: explicitly to designate the global namespace prevents the compiler from prepending any namespace names itself - this is completely irrelevant when just using nullptr though.
edited 7 hours ago
answered 8 hours ago
Jesper JuhlJesper Juhl
18.8k32751
18.8k32751
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f56259783%2foperators-in-c-what-does-type0-mean%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
21
It means that this is old code that should be rewritten to use
nullptr.– Sam Varshavchik
8 hours ago