From cb554642d487ebda736a0da5d30bcf3879a6c893 Mon Sep 17 00:00:00 2001 From: redi Date: Fri, 1 May 2015 11:02:18 +0000 Subject: * include/std/memory (pointer_safety, declare_reachable, undeclare_reachable, declare_no_pointers, undeclare_no_pointers, get_pointer_safety): Define. * testsuite/20_util/pointer_safety/1.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222674 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/include/std/memory | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'libstdc++-v3/include/std') diff --git a/libstdc++-v3/include/std/memory b/libstdc++-v3/include/std/memory index 4257394a0eb..3ed53b83e9e 100644 --- a/libstdc++-v3/include/std/memory +++ b/libstdc++-v3/include/std/memory @@ -126,6 +126,26 @@ align(size_t __align, size_t __size, void*& __ptr, size_t& __space) noexcept } } +// 20.7.4 [util.dynamic.safety], pointer safety + +enum class pointer_safety { relaxed, preferred, strict }; + +inline void +declare_reachable(void*) { } + +template + inline T* + undeclare_reachable(T* __p) { return __p; } + +inline void +declare_no_pointers(char*, size_t) { } + +inline void +undeclare_no_pointers(char*, size_t) { } + +inline pointer_safety +get_pointer_safety() noexcept { return pointer_safety::relaxed; } + _GLIBCXX_END_NAMESPACE_VERSION } // namespace #endif // _GLIBCXX_USE_C99_STDINT_TR1 -- cgit v1.2.1