Try to fix cadstar build #3: add operator<< for std::optional

This commit is contained in:
Roberto Fernandez Bautista 2023-03-16 22:44:29 +01:00
parent 55a379f61b
commit a05333541c
1 changed files with 14 additions and 0 deletions

View File

@ -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 );