From 68ca8ec3227d447c6898b7c75d8ea0fb82a4af36 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Dec 2010 10:36:15 +0200 Subject: Add lazy pointer support Built-in support is provided for raw, auto, and tr1 shared/weak pointers. New test: common/lazy-ptr. --- common/lazy-ptr/tr1-memory.hxx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 common/lazy-ptr/tr1-memory.hxx (limited to 'common/lazy-ptr/tr1-memory.hxx') diff --git a/common/lazy-ptr/tr1-memory.hxx b/common/lazy-ptr/tr1-memory.hxx new file mode 100644 index 0000000..8965861 --- /dev/null +++ b/common/lazy-ptr/tr1-memory.hxx @@ -0,0 +1,41 @@ +// file : common/lazy-ptr/tr1-memory.hxx +// author : Boris Kolpackov +// copyright : not copyrighted - public domain + +#ifndef TR1_MEMORY_HXX +#define TR1_MEMORY_HXX + +//@@ tmp +#define HAVE_TR1_MEMORY + +// +// Try to include TR1 in a compiler-specific manner. Fall-back +// on the Boost TR1 implementation if the compiler does not support TR1. +// + +#include // __GLIBCXX__, _HAS_TR1 + +// GNU C++ or Intel C++ using libstd++. +// +#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) +# include +// +// IBM XL C++. +// +#elif defined (__xlC__) && __xlC__ >= 0x0900 +# define __IBMCPP_TR1__ +# include +// +// VC++ or Intel C++ using VC++ standard library. +// +#elif defined (_MSC_VER) && \ + (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) +# include +// +// Boost fall-back. +// +#else +# include +#endif + +#endif // TR1_MEMORY_HXX -- cgit v1.1