std::initializer_list

static_polymorphism
Bradlee Speice 2020-09-07 02:20:23 -04:00
parent 5ba3978f2c
commit 3e4760a727
1 changed files with 6 additions and 4 deletions

View File

@ -694,10 +694,7 @@ the struct, `Vec` can't forward args to this initializer method.
That said, open question as to whether the move vs. construct-in-place/placement new matters given
an optimizing compiler: https://stackoverflow.com/a/36919571
# Potentially excluded
Some ideas related to traits, but that I'm not sure sufficiently fit the theme. May be worth
investigating in a future post?
Also: `std::initializer_list` (although Rust can get _very_ close with macros: `vec!`).
# CRTP
@ -713,6 +710,11 @@ Review of the examples Wikipedia gives:
data.
- Polymorphic chaining: Feel free to return `Self`, `&Self`, etc., builder patterns aren't new.
# Potentially excluded
Some ideas related to traits, but that I'm not sure sufficiently fit the theme. May be worth
investigating in a future post?
## Visibility
Worth acknowledging that C++ can do interesting things with `protected`, `friend`, and others, that