From b3355962ee7a1f1c6ea2f70cd35a7082b16d11db Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Sun, 26 Oct 2014 11:29:54 -0700 Subject: [PATCH] rewrite C++11 check to look for basic classes --- m4/ax_cxx_compile_stdcxx_11.m4 | 36 +++++++++++++++------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 index 163a4c6..86ff454 100644 --- a/m4/ax_cxx_compile_stdcxx_11.m4 +++ b/m4/ax_cxx_compile_stdcxx_11.m4 @@ -1,4 +1,4 @@ -# ============================================================================ + ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # @@ -37,30 +37,26 @@ #serial 4 m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; + // Checks that standard libraries are available. + #include + #include + #include - struct Base { - virtual void f() {} - }; - struct Child : public Base { - virtual void f() override {} - }; + using namespace std::placeholders; - typedef check> right_angle_brackets; + bool testFn(std::function op) { + return op(42); + } - int a; - decltype(a) b; + bool lenCheck(const std::shared_ptr &str, int len) { + return str->size() > len; + } - typedef check check_type; - check_type c; - check_type&& cr = static_cast(c); + void check() { + std::shared_ptr str(new std::string("hello world")); - auto d = a; - auto l = [](){}; + testFn(std::bind(lenCheck, str, _1)); + } ]]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl