I am unclear if the correct code to pass an optional vector of ints to a function by reference is :
void test_func(std::optional<std::vector<int>&> vec)
or
void test_func(std::optional<std::vector<int>>& vec)
Any help much appreciated.
A non-owning pointer is a nullable reference type.
void test_func(std::vector<int>* vec)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With