Skip to content
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

[range.istream, range.take.while.sentinel] Initialize member pointer … #3605

Merged
merged 1 commit into from Jan 5, 2020

Conversation

JohelEGP
Copy link
Contributor

@JohelEGP JohelEGP commented Jan 4, 2020

…conventionally

@jensmaurer
Copy link
Member

While my personal style prefers using "= nullptr" for the default member initializer as well, is there any rationale why we should prefer this over value-initialization in the standard? Consistency with other such uses, maybe?

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Jan 5, 2020

Yes. Consistency is what I meant by conventionally. After this, egrep '.*\*.*\{\};' * results in

declarations.tex:int* e {};                      // initialization to zero / null pointer
declarations.tex:int** pp {};                        // initialized to null pointer

for pointers, and egrep '.*\*.*= *nullptr *;' *

expressions.tex:  decltype(A<int>::f)* p2 = nullptr;    // error: the type \tcode{decltype(A<int>::f)} is invalid
iterators.tex:    Container* container = nullptr;
iterators.tex:    Container* container = nullptr;
iterators.tex:    Container* container = nullptr;
iterators.tex:    basic_ostream<charT,traits>* out_stream = nullptr;          // \expos
iterators.tex:    const charT* delim = nullptr;                               // \expos
iterators.tex:    streambuf_type* sbuf_ = nullptr;    // \expos
ranges.tex:    basic_istream<CharT, Traits>* @\exposid{stream_}@ = nullptr;    // \expos
ranges.tex:    basic_istream_view* @\exposid{parent_}@ = nullptr;                      // \expos
ranges.tex:    R* @\exposid{r_}@ = nullptr;            // \expos
ranges.tex:    filter_view* @\exposid{parent_}@ = nullptr;             // \expos
ranges.tex:    @\exposid{Parent}@* @\exposid{parent_}@ = nullptr;                  // \expos
ranges.tex:    const Pred* @\exposid{pred_}@ = nullptr;                        // \expos
ranges.tex:    @\exposid{Parent}@* @\exposid{parent_}@ = nullptr;                                  // \expos
ranges.tex:    @\exposid{Parent}@* @\exposid{parent_}@ = nullptr;              // \expos

@jensmaurer jensmaurer merged commit 6e769c3 into cplusplus:master Jan 5, 2020
@JohelEGP JohelEGP deleted the ranges_nullptr branch January 5, 2020 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants