Commit 529dd56f authored by Dominik Charousset's avatar Dominik Charousset

added convenience constructor to `option`

a constructor call with two or more arguments is now considered to be
value initialization
parent f40031d0
......@@ -62,6 +62,13 @@ class option {
*/
option(T value) : m_valid(false) { cr(std::move(value)); }
template<typename T0, typename T1, typename... Ts>
option(T0&& arg0, T1&& arg1, Ts&&... args) {
cr(T(std::forward<T0>(arg0),
std::forward<T1>(arg1),
std::forward<Ts>(args)...));
}
option(const option& other) : m_valid(false) {
if (other.m_valid) cr(other.m_value);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment