Last active
September 4, 2018 00:02
-
-
Save Bak-Jin-Hyeong/986653f9ae2362e457bf5c7a92551437 to your computer and use it in GitHub Desktop.
#include <absl/container/inlined_vector.h> without defining _SCL_SECURE_NO_WARNINGS globally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef ABSEILINLINEDVECTOR__H__ | |
| #define ABSEILINLINEDVECTOR__H__ | |
| #include <algorithm> | |
| #include <cassert> | |
| #include <climits> | |
| #include <cstddef> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <initializer_list> | |
| #include <iterator> | |
| #include <limits> | |
| #include <memory> | |
| #include <new> | |
| #include <string> | |
| #include <type_traits> | |
| #include <utility> | |
| // It is ugly but better than defining _SCL_SECURE_NO_WARNINGS globally. | |
| #if defined(_MSC_VER) && (_ITERATOR_DEBUG_LEVEL > 0 && _SECURE_SCL_DEPRECATE) | |
| #define copy _Copy_no_deprecate | |
| #define move _Move_no_deprecate | |
| #define move_backward _Move_backward_unchecked | |
| #define swap_ranges _Swap_ranges_unchecked | |
| #define uninitialized_copy _Uninitialized_copy_unchecked | |
| namespace std | |
| { | |
| template<class _Ty> | |
| _NODISCARD constexpr remove_reference_t<_Ty>&& | |
| _Move_no_deprecate(_Ty&& _Arg) noexcept | |
| { // forward _Arg as movable | |
| return (static_cast<remove_reference_t<_Ty>&&>(_Arg)); | |
| } | |
| } | |
| #include <absl/container/inlined_vector.h> | |
| #undef uninitialized_copy | |
| #undef move | |
| #undef move_backward | |
| #undef swap_ranges | |
| #undef copy | |
| #else | |
| #include <absl/container/inlined_vector.h> | |
| #endif // #if defined(_MSC_VER) && !defined(_SCL_SECURE_NO_WARNINGS) | |
| #endif // #ifndef ABSEILINLINEDVECTOR__H__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment