Skip to content

Commit

Permalink
Merge pull request #21 from yumetodo/fix/clang3_4
Browse files Browse the repository at this point in the history
fix: support clang3.4.2 (重要注意事項あり)
  • Loading branch information
AsPJT committed May 20, 2019
2 parents 942ed34 + 61b966f commit 3091b6b
Show file tree
Hide file tree
Showing 57 changed files with 101 additions and 79 deletions.
6 changes: 3 additions & 3 deletions include/DTL/Base/Struct.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ namespace dtl {
template<typename Int_>
struct Coordinate1Dimensional {
Int_ x{};
constexpr Coordinate1Dimensional() noexcept = default;
constexpr Coordinate1Dimensional() = default;
constexpr Coordinate1Dimensional(const Int_& x_) noexcept :x(x_) {};
};

template<typename Int_>
struct Coordinate2Dimensional {
Int_ x{};
Int_ y{};
constexpr Coordinate2Dimensional() noexcept = default;
constexpr Coordinate2Dimensional() = default;
constexpr Coordinate2Dimensional(const Int_& x_, const Int_& y_) noexcept :x(x_), y(y_) {};

constexpr bool operator==(const ::dtl::base::Coordinate2Dimensional<Int_>& vec2_) const noexcept {
Expand All @@ -46,7 +46,7 @@ namespace dtl {
Int_ y{};
Int_ w{};
Int_ h{};
constexpr Coordinate2DimensionalAndLength2Dimensional() noexcept = default;
constexpr Coordinate2DimensionalAndLength2Dimensional() = default;
constexpr Coordinate2DimensionalAndLength2Dimensional(const Int_& x_, const Int_& y_) noexcept
:x(x_), y(y_) {};
constexpr Coordinate2DimensionalAndLength2Dimensional(const Int_& x_, const Int_& y_, const Int_& l_) noexcept
Expand Down
3 changes: 2 additions & 1 deletion include/DTL/Board/WriteNumber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_BOARD_WRITE_NUMBER_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_BOARD_WRITE_NUMBER_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <sstream>
#include <string>
#include <DTL/Base/Struct.hpp>
Expand Down Expand Up @@ -371,7 +372,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr WriteNumber() noexcept = default;
constexpr WriteNumber() = default;

constexpr explicit WriteNumber(const OutputString_& new_line_string_) noexcept
:new_line_string(new_line_string_) {}
Expand Down
6 changes: 3 additions & 3 deletions include/DTL/Camera/MatrixView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace dtl {
inline namespace camera {

struct MatrixViewRect {
constexpr MatrixViewRect() noexcept = default;
constexpr MatrixViewRect() = default;
std::int_fast32_t start_x{};
std::int_fast32_t start_y{};
std::int_fast32_t end_x{};
Expand All @@ -27,7 +27,7 @@ namespace dtl {

class SampleMatrixViewDraw {
public:
constexpr SampleMatrixViewDraw() noexcept = default;
constexpr SampleMatrixViewDraw() = default;
template<typename Matrix_> //maybe_unused
DTL_VERSIONING_CPP14_CONSTEXPR
void draw(const Matrix_&, const std::int_fast32_t, const std::int_fast32_t, const std::int_fast32_t, const std::int_fast32_t, const std::int_fast32_t, const std::int_fast32_t, const std::int_fast32_t, const std::int_fast32_t) const noexcept {}
Expand Down Expand Up @@ -79,7 +79,7 @@ namespace dtl {
}

//コンストラクタ
constexpr MatrixView() noexcept = default;
constexpr MatrixView() = default;
constexpr MatrixView(const std::int_fast32_t window_width_, const std::int_fast32_t window_height_, const std::int_fast32_t pixel_width_, const std::int_fast32_t pixel_height_, const double target_x_, const double target_y_) noexcept
:window_width(window_width_),
window_height(window_height_),
Expand Down
3 changes: 2 additions & 1 deletion include/DTL/Console/OutputNumber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_NUMBER_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_NUMBER_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <iostream>
#include <string>
#include <DTL/Base/Struct.hpp>
Expand Down Expand Up @@ -398,7 +399,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr OutputNumber() noexcept = default;
constexpr OutputNumber() = default;
constexpr explicit OutputNumber(const OutputString_ & draw_string_) noexcept
:after_string(draw_string_) {}
constexpr explicit OutputNumber(const OutputString_ & before_draw_string_, const OutputString_ & draw_string_) noexcept
Expand Down
3 changes: 2 additions & 1 deletion include/DTL/Console/OutputString.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_STRING_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_STRING_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <iostream>
#include <string>
#include <vector>
Expand Down Expand Up @@ -386,7 +387,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr OutputString() noexcept = default;
constexpr OutputString() = default;
template<typename ...Args_>
explicit OutputString(const OutputStringName_ & first_, const Args_ & ... args_) noexcept {
this->string_String(first_, args_...);
Expand Down
3 changes: 2 additions & 1 deletion include/DTL/Console/OutputStringBool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_STRING_BOOL_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_STRING_BOOL_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <iostream>
#include <string>
#include <DTL/Base/Struct.hpp>
Expand Down Expand Up @@ -454,7 +455,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr OutputStringBool() noexcept = default;
constexpr OutputStringBool() = default;
constexpr explicit OutputStringBool(const OutputString_ & true_string_) noexcept
:true_string(true_string_) {}
constexpr explicit OutputStringBool(const OutputString_ & true_string_, const OutputString_ & false_string_) noexcept
Expand Down
3 changes: 2 additions & 1 deletion include/DTL/Console/OutputView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_VIEW_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_CONSOLE_OUTPUT_VIEW_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <iostream>
#include <string>
#include <DTL/Base/Struct.hpp>
Expand Down Expand Up @@ -351,7 +352,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr OutputView() noexcept = default;
constexpr OutputView() = default;
constexpr explicit OutputView(const OutputView_& view_) noexcept
:view_width(view_), view_height(view_) {}
constexpr explicit OutputView(const OutputView_& view_width_, const OutputView_& view_height_) noexcept
Expand Down
6 changes: 3 additions & 3 deletions include/DTL/Deprecated/BoardGame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ namespace dtl {
class Chess {
public:
//コンストラクタ
constexpr Chess() noexcept = default;
constexpr Chess() = default;
template<typename Matrix_>
DTL_VERSIONING_CPP14_CONSTEXPR
explicit Chess(Matrix_& matrix_) noexcept {
Expand Down Expand Up @@ -360,7 +360,7 @@ namespace dtl {
class Chess {
public:
//コンストラクタ
constexpr Chess() noexcept = default;
constexpr Chess() = default;
template<typename Matrix_>
DTL_VERSIONING_CPP14_CONSTEXPR
explicit Chess(Matrix_& matrix_, const ::dtl::type::size x_, const ::dtl::type::size y_) noexcept {
Expand Down Expand Up @@ -546,7 +546,7 @@ namespace dtl {
return true;
}
//コンストラクタ
constexpr KnightTour() noexcept = default;
constexpr KnightTour() = default;
template<typename Matrix_>
explicit KnightTour(Matrix_ & matrix_, const ::dtl::type::size x_, const ::dtl::type::size y_, const ::dtl::type::size start_x_ = 0, const ::dtl::type::size start_y_ = 0, const bool is_closed_ = false, const Matrix_Int_ mod_value_ = 0) noexcept {
create(matrix_, x_, y_, start_x_, start_y_, is_closed_, mod_value_);
Expand Down
1 change: 1 addition & 0 deletions include/DTL/Deprecated/DungeonFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_DUNGEON_FILE_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_DUNGEON_FILE_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <cstdint>
#include <fstream>
#include <string>
Expand Down
1 change: 1 addition & 0 deletions include/DTL/Deprecated/DungeonNoise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#ifndef INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_DUNGEON_NOISE_HPP
#define INCLUDED_DUNGEON_TEMPLATE_LIBRARY_DTL_DUNGEON_NOISE_HPP

#include <DTL/Workaround/cstdioGets.hpp>
#include <DTL/Random/MersenneTwister32bit.hpp>
#include <DTL/Macros/nodiscard.hpp>
#include <DTL/Macros/constexpr.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Deprecated/DungeonPaint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace dtl {
class Bucket {
public:
//コンストラクタ
constexpr Bucket() noexcept = default;
constexpr Bucket() = default;
template<typename Matrix_>
DTL_VERSIONING_CPP14_CONSTEXPR
explicit Bucket(Matrix_& matrix_, const std::int_fast32_t col_, const std::int_fast32_t row_, const Matrix_Int_ paint_value_) noexcept {
Expand Down
6 changes: 3 additions & 3 deletions include/DTL/Deprecated/RogueLike.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace dtl {
//四角形の位置と大きさ
template<typename Matrix_Int_>
struct RogueLikeOutputNumber {
constexpr RogueLikeOutputNumber() noexcept = default;
constexpr RogueLikeOutputNumber() = default;
//位置
Matrix_Int_ x{}, y{};
//大きさ
Expand All @@ -52,7 +52,7 @@ namespace dtl {
class RogueLike {
public:
//コンストラクタ
constexpr RogueLike() noexcept = default;
constexpr RogueLike() = default;
template<typename Matrix_>
DTL_VERSIONING_CPP14_CONSTEXPR
explicit RogueLike(Matrix_& matrix_, const ::dtl::type::size way_max_ = 20) noexcept {
Expand Down Expand Up @@ -282,7 +282,7 @@ namespace dtl {
class RogueLikeCave {
public:
//コンストラクタ
constexpr RogueLikeCave() noexcept = default;
constexpr RogueLikeCave() = default;
template<typename Matrix_>
DTL_VERSIONING_CPP14_CONSTEXPR
explicit RogueLikeCave(Matrix_& matrix_, const ::dtl::type::size way_max_ = 20) noexcept {
Expand Down
40 changes: 22 additions & 18 deletions include/DTL/Macros/nodiscard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,32 @@

///// DTL_VERSIONING_CPP17_NODISCARDがない場合 /////
#ifndef DTL_VERSIONING_CPP17_NODISCARD
#ifdef __has_cpp_attribute
# if defined(__has_cpp_attribute) && 201402 < __cplusplus

#if __has_cpp_attribute(nodiscard)
#define DTL_VERSIONING_CPP17_NODISCARD [[nodiscard]]
#endif
# if __has_cpp_attribute(nodiscard)
# define DTL_VERSIONING_CPP17_NODISCARD [[nodiscard]]
# endif

#elif defined(__clang__)
#define DTL_VERSIONING_CPP17_NODISCARD __attribute__((warn_unused_result))
# elif defined(__clang__) || defined(__GNUC__)
# define DTL_VERSIONING_CPP17_NODISCARD __attribute__((warn_unused_result))

#elif defined(_MSC_VER)
# elif defined(_MSC_VER)
# if 1911 <= _MSC_VER && 201402 < _MSVC_LANG
# define DTL_VERSIONING_CPP17_NODISCARD [[nodiscard]]
# else
// _Must_inspect_result_ expands into this
#define DTL_VERSIONING_CPP17_NODISCARD \
__declspec("SAL_name" \
"(" \
"\"_Must_inspect_result_\"" \
"," \
"\"\"" \
"," \
"\"2\"" \
")") __declspec("SAL_begin") __declspec("SAL_post") __declspec("SAL_mustInspect") __declspec("SAL_post") __declspec("SAL_checkReturn") __declspec("SAL_end")

#endif
# define DTL_VERSIONING_CPP17_NODISCARD \
__declspec( "SAL_name" \
"(" \
"\"_Must_inspect_result_\"" \
"," \
"\"\"" \
"," \
"\"2\"" \
")") __declspec("SAL_begin") __declspec("SAL_post") __declspec("SAL_mustInspect") __declspec("SAL_post") __declspec("SAL_checkReturn") __declspec("SAL_end")
# endif

# endif
#endif

///// もしDTL_VERSIONING_CPP17_NODISCARDが無かったらつくる /////
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Retouch/BuryPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr BuryPoint() noexcept = default;
constexpr BuryPoint() = default;
constexpr explicit BuryPoint(const ::dtl::base::MatrixRange& matrix_range_) noexcept
:start_x(matrix_range_.x), start_y(matrix_range_.y),
width(matrix_range_.w), height(matrix_range_.h) {}
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Retouch/RemovePoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr RemovePoint() noexcept = default;
constexpr RemovePoint() = default;
constexpr explicit RemovePoint(const ::dtl::base::MatrixRange& matrix_range_) noexcept
:start_x(matrix_range_.x), start_y(matrix_range_.y),
width(matrix_range_.w), height(matrix_range_.h) {}
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/AbsoluteMemberRect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr AbsoluteMemberRect() noexcept = default;
constexpr AbsoluteMemberRect() = default;
constexpr explicit AbsoluteMemberRect(const Matrix_Int_& draw_value_) noexcept
:absoluteRect(draw_value_) {}
constexpr explicit AbsoluteMemberRect(const ::dtl::base::MatrixRange& matrix_range_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/Border.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr Border() noexcept = default;
constexpr Border() = default;
constexpr explicit Border(const Matrix_Int_ & draw_value_) noexcept
:draw_value(draw_value_) {}
constexpr explicit Border(const ::dtl::base::MatrixRange & matrix_range_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/BorderOdd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr BorderOdd() noexcept = default;
constexpr BorderOdd() = default;
constexpr explicit BorderOdd(const Matrix_Int_ & draw_value_) noexcept
:draw_value(draw_value_) {}
constexpr explicit BorderOdd(const ::dtl::base::MatrixRange & matrix_range_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/CellularAutomatonIsland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr CellularAutomatonIsland() noexcept = default;
constexpr CellularAutomatonIsland() = default;
constexpr explicit CellularAutomatonIsland(const Matrix_Int_ & draw_value_) noexcept
:randomRect(draw_value_) {}

Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/CellularAutomatonMixIsland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr CellularAutomatonMixIsland() noexcept = default;
constexpr CellularAutomatonMixIsland() = default;
template<typename ...Args_>
explicit CellularAutomatonMixIsland(const Index_Size & loop_num_, const Matrix_Int_ & first_, const Args_ & ... args_) noexcept
:border(first_), mixRect(first_, args_...), loop_num(loop_num_) {}
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/DiamondSquareAverageCornerIsland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr DiamondSquareAverageCornerIsland() noexcept = default;
constexpr DiamondSquareAverageCornerIsland() = default;
constexpr explicit DiamondSquareAverageCornerIsland(const Matrix_Int_ & min_value_) noexcept
:min_value(min_value_) {}
constexpr explicit DiamondSquareAverageCornerIsland(const Matrix_Int_ & min_value_, const Matrix_Int_ & altitude_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/DiamondSquareAverageIsland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr DiamondSquareAverageIsland() noexcept = default;
constexpr DiamondSquareAverageIsland() = default;
constexpr explicit DiamondSquareAverageIsland(const Matrix_Int_ & min_value_) noexcept
:min_value(min_value_) {}
constexpr explicit DiamondSquareAverageIsland(const Matrix_Int_ & min_value_, const Matrix_Int_ & altitude_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/FractalIsland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr FractalIsland() noexcept = default;
constexpr FractalIsland() = default;
constexpr explicit FractalIsland(const Matrix_Int_ & min_value_) noexcept
:min_value(min_value_) {}
constexpr explicit FractalIsland(const Matrix_Int_ & min_value_, const Matrix_Int_ & altitude_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/FractalLoopIsland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr FractalLoopIsland() noexcept = default;
constexpr FractalLoopIsland() = default;
constexpr explicit FractalLoopIsland(const Matrix_Int_ & min_value_) noexcept
:min_value(min_value_) {}
constexpr explicit FractalLoopIsland(const Matrix_Int_ & min_value_, const Matrix_Int_ & altitude_) noexcept
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/HalfMixRect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr HalfMixRect() noexcept = default;
constexpr HalfMixRect() = default;
template<typename ...Args_>
explicit HalfMixRect(const Matrix_Int_ & first_, const Args_ & ... args_) noexcept {
this->string_String(first_, args_...);
Expand Down
2 changes: 1 addition & 1 deletion include/DTL/Shape/MazeDig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ namespace dtl {

///// コンストラクタ /////

constexpr MazeDig() noexcept = default;
constexpr MazeDig() = default;
constexpr explicit MazeDig(const Matrix_Int_ & empty_value_) noexcept
:empty_value(empty_value_) {}
constexpr explicit MazeDig(const Matrix_Int_& empty_value_, const Matrix_Int_& wall_value_) noexcept
Expand Down

0 comments on commit 3091b6b

Please sign in to comment.