diff --git a/build/PomdogTest.xcodeproj/project.pbxproj b/build/PomdogTest.xcodeproj/project.pbxproj index aea6b2bd1..4a2ef5d15 100644 --- a/build/PomdogTest.xcodeproj/project.pbxproj +++ b/build/PomdogTest.xcodeproj/project.pbxproj @@ -30,7 +30,6 @@ 6129C2109DE7037DF83E0A9B /* RectangleTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59FAE4E36E7F1AAE4C407249 /* RectangleTest.cpp */; }; 6C7A6F69812868116B079288 /* HelpersTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 63C0EEE2389B31A820E16FC6 /* HelpersTest.cpp */; }; 7E14449EE47BF435E52F1C65 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C8B6E715F53F2A76D934FF5 /* OpenAL.framework */; }; - 8032E3672467CDE73CE05648 /* OptionalTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF09AA6292C4D37900470F54 /* OptionalTest.cpp */; }; 898EC5DF217E2CB9E105A128 /* ColorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7BE654D231E2A773E422E584 /* ColorTest.cpp */; }; 9A05AEA543A1E079508C15CB /* EventQueueTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 428A57A57AE039FA558896B7 /* EventQueueTest.cpp */; }; A3EC3906EE7827D6DC7AFC91 /* InputLayoutHelperTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 686C1E3D26ECF58CB051CDA2 /* InputLayoutHelperTest.cpp */; }; @@ -72,7 +71,6 @@ A90B09A11C25A774006E749D /* SignalTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F7CE69F5DD42360EB98DFF3D /* SignalTest.cpp */; }; A90B09A21C25A774006E749D /* AnyTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 77663FF3E685ADC8A75D0FD7 /* AnyTest.cpp */; }; A90B09A31C25A774006E749D /* CRC32Test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 88F7365A44BD5B233D38B9E8 /* CRC32Test.cpp */; }; - A90B09A41C25A774006E749D /* OptionalTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF09AA6292C4D37900470F54 /* OptionalTest.cpp */; }; A90B09A51C25A774006E749D /* StringHelperTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 688D76EAF77908A3BB3B8E58 /* StringHelperTest.cpp */; }; A90B09AA1C25A774006E749D /* AudioToolBox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF2591B788324D90FD154981 /* AudioToolBox.framework */; }; A90B09AB1C25A774006E749D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C8B6E715F53F2A76D934FF5 /* OpenAL.framework */; }; @@ -195,7 +193,6 @@ A9FF23B11C258DDC00AE7D7B /* zlib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = zlib.xcodeproj; path = build/dependencies/zlib.xcodeproj; sourceTree = ""; }; A9FF23B71C258DE200AE7D7B /* libpng.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libpng.xcodeproj; path = build/dependencies/libpng.xcodeproj; sourceTree = ""; }; AA8FF4E1E145E644B6DCBF5B /* KeysTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = KeysTest.cpp; sourceTree = ""; }; - CF09AA6292C4D37900470F54 /* OptionalTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = OptionalTest.cpp; sourceTree = ""; }; D052B39A97086C615E3B21C9 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; D8F1F6F7CC0ACB1CF8F7DD09 /* KeyboardStateTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = KeyboardStateTest.cpp; sourceTree = ""; }; DF87E2EA6D1C796C51A886A7 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; @@ -408,7 +405,6 @@ children = ( 77663FF3E685ADC8A75D0FD7 /* AnyTest.cpp */, 88F7365A44BD5B233D38B9E8 /* CRC32Test.cpp */, - CF09AA6292C4D37900470F54 /* OptionalTest.cpp */, 688D76EAF77908A3BB3B8E58 /* StringHelperTest.cpp */, ); path = Utility; @@ -588,7 +584,6 @@ AC82087613EF8055F7E48199 /* SignalTest.cpp in Sources */, DFE8014D0200C170A0A7C358 /* AnyTest.cpp in Sources */, 0CF0D48D88520AB807097760 /* CRC32Test.cpp in Sources */, - 8032E3672467CDE73CE05648 /* OptionalTest.cpp in Sources */, 4C0C4CC3655F3CFB6B5028DD /* StringHelperTest.cpp in Sources */, A93CA65D1D92F37300B65171 /* TaskTest.cpp in Sources */, ); @@ -639,7 +634,6 @@ A90B09A11C25A774006E749D /* SignalTest.cpp in Sources */, A90B09A21C25A774006E749D /* AnyTest.cpp in Sources */, A90B09A31C25A774006E749D /* CRC32Test.cpp in Sources */, - A90B09A41C25A774006E749D /* OptionalTest.cpp in Sources */, A90B09A51C25A774006E749D /* StringHelperTest.cpp in Sources */, A93CA65E1D92F37300B65171 /* TaskTest.cpp in Sources */, ); diff --git a/build/pomdog.xcodeproj/project.pbxproj b/build/pomdog.xcodeproj/project.pbxproj index b4f1a1ef7..3b6c17708 100644 --- a/build/pomdog.xcodeproj/project.pbxproj +++ b/build/pomdog.xcodeproj/project.pbxproj @@ -489,7 +489,6 @@ 6FA7E5627F938A07E599E894 /* PipelineState.hpp */ = {isa = PBXFileReference; lastKnownFileType = text; path = PipelineState.hpp; sourceTree = ""; }; 6FEF518DFA0D88D584748D4A /* SurfaceFormatHelper.hpp */ = {isa = PBXFileReference; lastKnownFileType = text; path = SurfaceFormatHelper.hpp; sourceTree = ""; }; 7056C40C787B58417326C40C /* Keyboard.hpp */ = {isa = PBXFileReference; lastKnownFileType = text; path = Keyboard.hpp; sourceTree = ""; }; - 7185E7CA90AF57C1C02FFC82 /* Optional.hpp */ = {isa = PBXFileReference; lastKnownFileType = text; path = Optional.hpp; sourceTree = ""; }; 72397B6027D9DE47C449E8A9 /* EventQueue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = EventQueue.cpp; sourceTree = ""; }; 72CA22E1FE9B445BAA963FBF /* RenderTarget2DGL4.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTarget2DGL4.cpp; sourceTree = ""; }; 74C791C392D2DF46A553FC0F /* ErrorChecker.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorChecker.cpp; sourceTree = ""; }; @@ -892,7 +891,6 @@ AC349E78729FC3024C1BC5D9 /* Assert.hpp */, 31FBEAA10D334ADAB5DBA52F /* Exception.hpp */, B287AAFFF99539C6D6462CD8 /* FileSystem.hpp */, - 7185E7CA90AF57C1C02FFC82 /* Optional.hpp */, E9B28A755CD1F1F43CA87DC7 /* PathHelper.hpp */, 5A8B5ACA584E5FAFC97F8269 /* StringHelper.hpp */, ); diff --git a/build/pomdog/CMakeLists.txt b/build/pomdog/CMakeLists.txt index 634fdf2c1..b8974ae92 100644 --- a/build/pomdog/CMakeLists.txt +++ b/build/pomdog/CMakeLists.txt @@ -234,7 +234,6 @@ set(POMDOG_SOURCES_CORE ${POMDOG_DIR}/include/Pomdog/Utility/Assert.hpp ${POMDOG_DIR}/include/Pomdog/Utility/Exception.hpp ${POMDOG_DIR}/include/Pomdog/Utility/FileSystem.hpp - ${POMDOG_DIR}/include/Pomdog/Utility/Optional.hpp ${POMDOG_DIR}/include/Pomdog/Utility/PathHelper.hpp ${POMDOG_DIR}/include/Pomdog/Utility/StringHelper.hpp ${POMDOG_DIR}/include/Pomdog/Utility/detail/CRC32.hpp diff --git a/include/Pomdog/Pomdog.hpp b/include/Pomdog/Pomdog.hpp index d46338462..281a5e183 100644 --- a/include/Pomdog/Pomdog.hpp +++ b/include/Pomdog/Pomdog.hpp @@ -148,7 +148,6 @@ namespace Pomdog {} #include "Utility/Assert.hpp" #include "Utility/Exception.hpp" #include "Utility/FileSystem.hpp" -#include "Utility/Optional.hpp" #include "Utility/PathHelper.hpp" #include "Utility/StringHelper.hpp" diff --git a/include/Pomdog/Utility/Optional.hpp b/include/Pomdog/Utility/Optional.hpp deleted file mode 100644 index 0ebb18e1c..000000000 --- a/include/Pomdog/Utility/Optional.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2013-2018 mogemimi. Distributed under the MIT license. - -#pragma once - -#if __has_include() -#include -#else -#include -#endif - -namespace Pomdog { - -#if __has_include() -template -using Optional = std::optional; - -constexpr auto NullOpt = std::nullopt; - -template -inline constexpr Optional MakeOptional(T && v) -{ - return std::make_optional(std::forward(v)); -} -#else -template -using Optional = std::experimental::optional; - -constexpr auto NullOpt = std::experimental::nullopt; - -template -inline constexpr Optional MakeOptional(T && v) -{ - return std::experimental::make_optional(std::forward(v)); -} -#endif - -} // namespace Pomdog diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bf064c91a..d62e202e5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -70,7 +70,6 @@ add_executable(PomdogTest ${POMDOG_TEST_DIR}/Signals/SignalTest.cpp ${POMDOG_TEST_DIR}/Utility/AnyTest.cpp ${POMDOG_TEST_DIR}/Utility/CRC32Test.cpp - ${POMDOG_TEST_DIR}/Utility/OptionalTest.cpp ${POMDOG_TEST_DIR}/Utility/StringHelperTest.cpp ) diff --git a/test/Utility/OptionalTest.cpp b/test/Utility/OptionalTest.cpp deleted file mode 100644 index 5717cc48c..000000000 --- a/test/Utility/OptionalTest.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2013-2018 mogemimi. Distributed under the MIT license. - -#include -#include -#include - -using Pomdog::Optional; - -TEST(Optional, FirstCase) -{ - Optional number; - ASSERT_FALSE(number); - ASSERT_TRUE(!number); - - number = 42; - ASSERT_TRUE(number); - ASSERT_FALSE(!number); - ASSERT_EQ(42, *number); - - number = Pomdog::NullOpt; - ASSERT_FALSE(number); - ASSERT_TRUE(!number); -} - -TEST(Optional, CopyConstructor) -{ - Optional number; - ASSERT_FALSE(number); - - { - auto other = number; - ASSERT_FALSE(other); - ASSERT_TRUE(!other); - } - - number = 42; - ASSERT_TRUE(number); - ASSERT_EQ(42, *number); - - { - auto other = number; - ASSERT_TRUE(other); - ASSERT_FALSE(!other); - ASSERT_EQ(42, *other); - } - - number = Pomdog::NullOpt; - ASSERT_FALSE(number); - - { - auto other = number; - ASSERT_FALSE(other); - ASSERT_TRUE(!other); - } -}