boost::optional<std::vector<std::wstring>> filePath;
If I have the above boost optional vector is it possible to then pass this by reference and as an optional parameter?
Test(const boost::filesystem::path& targetPath, boost::optional<std::vector<std::wstring>> filePath = boost::none);
Could I pass filePath
as a default parameter and by reference at the same time?
What you are doing is legal, but you can't pass a reference as a default parameter. Should you want that, you'd need to pass a value, or the file path wrapped around another boost::optional.