Include <optional> from dedicated file optional.hpp

This commit is contained in:
Valeriy Bykov 2017-06-14 19:54:22 +03:00
parent b1a1120602
commit 20ea506b31
5 changed files with 18 additions and 33 deletions

View File

@ -5,16 +5,8 @@
#include <stdint.h>
#include <sstream>
// This should be removed once C++17 is widely available
#if __has_include(<optional>)
# include <optional>
namespace opt = std;
#else
# include <compat/optional.hpp>
namespace opt = std::experimental;
#endif
#include <valijson/adapters/adapter.hpp>
#include <valijson/internal/optional.hpp>
namespace valijson {
namespace adapters {

View File

@ -9,15 +9,8 @@
#include <stdexcept>
#include <string>
#if __has_include(<optional>)
# include <optional>
namespace opt = std;
#else
# include <compat/optional.hpp>
namespace opt = std::experimental;
#endif
#include <valijson/adapters/adapter.hpp>
#include <valijson/internal/optional.hpp>
namespace valijson {
namespace internal {

View File

@ -5,13 +5,7 @@
#include <stdexcept>
#include <string>
#if __has_include(<optional>)
# include <optional>
namespace opt = std;
#else
# include <compat/optional.hpp>
namespace opt = std::experimental;
#endif
#include <valijson/internal/optional.hpp>
namespace valijson {
namespace internal {

View File

@ -0,0 +1,14 @@
#pragma once
#ifndef __VALIJSON_OPTIONAL_HPP
#define __VALIJSON_OPTIONAL_HPP
// This should be removed once C++17 is widely available
#if __has_include(<optional>)
# include <optional>
namespace opt = std;
#else
# include <compat/optional.hpp>
namespace opt = std::experimental;
#endif
#endif

View File

@ -6,16 +6,8 @@
#include <memory>
// This should be removed once C++17 is widely available
#if __has_include(<optional>)
# include <optional>
namespace opt = std;
#else
# include <compat/optional.hpp>
namespace opt = std::experimental;
#endif
#include <valijson/constraints/constraint.hpp>
#include <valijson/internal/optional.hpp>
namespace valijson {