Try to fix cadstar build #3: add operator<< for std::optional
This commit is contained in:
parent
55a379f61b
commit
a05333541c
|
@ -21,6 +21,7 @@
|
|||
#include <iostream>
|
||||
#include <qa_utils/wx_utils/unit_test_utils.h>
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
|
||||
#include <pegtl/contrib/analyze.hpp>
|
||||
#include <pegtl/contrib/trace.hpp>
|
||||
|
@ -30,6 +31,19 @@
|
|||
#include <common/plugins/cadstar/cadstar_parts_lib_parser.h>
|
||||
|
||||
|
||||
//Todo: move somewhere else?
|
||||
template <class T>
|
||||
std::ostream& operator<<( std::ostream& aOs, const std::optional<T>& aOptional )
|
||||
{
|
||||
if( aOptional.has_value() )
|
||||
aOs << aOptional.value();
|
||||
else
|
||||
aOs << "nullopt";
|
||||
|
||||
return aOs;
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE( CadstarPartParser );
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue