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/extractor.hpp"
|
||||||
#include "extractor/original_edge_data.hpp"
|
#include "extractor/original_edge_data.hpp"
|
||||||
#include "extractor/query_node.hpp"
|
#include "extractor/query_node.hpp"
|
||||||
|
#include "util/exception.hpp"
|
||||||
#include "util/fingerprint.hpp"
|
#include "util/fingerprint.hpp"
|
||||||
#include "util/simple_logger.hpp"
|
#include "util/simple_logger.hpp"
|
||||||
#include "util/static_graph.hpp"
|
#include "util/static_graph.hpp"
|
||||||
#include "util/exception.hpp"
|
|
||||||
|
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
#include <boost/iostreams/seek.hpp>
|
#include <boost/iostreams/seek.hpp>
|
||||||
|
|
||||||
#include <tuple>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
#include <cstring>
|
||||||
|
#include <tuple>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace osrm
|
namespace osrm
|
||||||
{
|
{
|
||||||
@ -57,8 +58,11 @@ class FileReader
|
|||||||
/* Read count objects of type T into pointer dest */
|
/* Read count objects of type T into pointer dest */
|
||||||
template <typename T> void ReadInto(T *dest, const std::size_t count)
|
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,
|
static_assert(std::is_trivially_copyable<T>::value,
|
||||||
"bytewise reading requires trivially copyable type");
|
"bytewise reading requires trivially copyable type");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#define isatty _isatty
|
#define isatty _isatty
|
||||||
#define fileno _fileno
|
#define fileno _fileno
|
||||||
#else
|
#else
|
||||||
#error Unknown platform - don't know which header to include for isatty()
|
#error Unknown platform - isatty implementation required
|
||||||
#endif // win32
|
#endif // win32
|
||||||
#endif // unix
|
#endif // unix
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user