save-state-1

This commit is contained in:
2023-04-12 16:05:22 -07:00
parent ff65bd12a5
commit 247b8c760a
23 changed files with 1480 additions and 150 deletions

18
sbf-cpp/Questions.md Normal file
View File

@@ -0,0 +1,18 @@
## Why do I have to cast std::nullopt to a specific optional type when calling a templated function i.e.
```c++
template<typename T>
void DoSomething(std::optional<T> = std::nullopt, bool report_errors = false);
```
```text
DoSomething() works fine.
DoSomething(std::nullopt, true) no matching function for call to 'DoSomething' Do_Something<std::optional<string>, bool>(
```
## Which is uglier
```c++
(*after_each)()
after_each->operator()()
after_each.value()();
```