2015-06-21 17:31:19 +02:00
|
|
|
#pragma once
|
2015-10-15 12:58:16 +02:00
|
|
|
#ifndef MESSMER_CPPUTILS_POINTER_UNIQUE_REF_BOOST_OPTIONAL_GTEST_WORKAROUND_H
|
|
|
|
#define MESSMER_CPPUTILS_POINTER_UNIQUE_REF_BOOST_OPTIONAL_GTEST_WORKAROUND_H
|
2015-06-18 19:35:30 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a workaround for using boost::optional<unique_ref<T>> in gtest.
|
|
|
|
* Without including this file, the linker will fail.
|
|
|
|
*/
|
|
|
|
|
2015-07-21 15:18:14 +02:00
|
|
|
//TODO Test that this solves the problem (add test unit file that doesn't compile without)
|
|
|
|
|
2015-06-18 19:35:30 +02:00
|
|
|
#include "unique_ref.h"
|
|
|
|
#include <boost/optional/optional_io.hpp>
|
|
|
|
//gtest/boost::optional workaround for working with optional<unique_ref<T>>
|
|
|
|
namespace boost {
|
|
|
|
template<typename T>
|
|
|
|
inline std::ostream& operator<<(std::ostream& out, const cpputils::unique_ref<T> &ref) {
|
|
|
|
out << ref.get();
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-21 15:18:14 +02:00
|
|
|
#endif
|