From 3e4760a7278988bb7ff06106e3378d54b31bf4da Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 7 Sep 2020 02:20:23 -0400 Subject: [PATCH] std::initializer_list --- _posts/2020-08-05-static-polymorphism.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/_posts/2020-08-05-static-polymorphism.md b/_posts/2020-08-05-static-polymorphism.md index 058192a..2d49080 100644 --- a/_posts/2020-08-05-static-polymorphism.md +++ b/_posts/2020-08-05-static-polymorphism.md @@ -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