Conditionally checks std::is_trivially_copyable only if available. (#3327)
This commit is contained in:
parent
d5bf508046
commit
73e365d398
@ -5,17 +5,18 @@
|
||||
#include "extractor/extractor.hpp"
|
||||
#include "extractor/original_edge_data.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/fingerprint.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/static_graph.hpp"
|
||||
#include "util/exception.hpp"
|
||||
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <boost/iostreams/seek.hpp>
|
||||
|
||||
#include <tuple>
|
||||
#include <cstring>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@ -57,8 +58,11 @@ class FileReader
|
||||
/* Read count objects of type T into pointer dest */
|
||||
template <typename T> void ReadInto(T *dest, const std::size_t count)
|
||||
{
|
||||
#if not defined __GNUC__ or __GNUC__ > 4
|
||||
static_assert(std::is_trivially_copyable<T>::value,
|
||||
"bytewise reading requires trivially copyable type");
|
||||
#endif
|
||||
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
#include <bitset>
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#define isatty _isatty
|
||||
#define fileno _fileno
|
||||
#else
|
||||
#error Unknown platform - don't know which header to include for isatty()
|
||||
#error Unknown platform - isatty implementation required
|
||||
#endif // win32
|
||||
#endif // unix
|
||||
|
||||
@ -29,4 +29,4 @@ inline bool IsStdoutATTY() { return isatty(fileno(stdout)); }
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user