mirror of
https://github.com/vgough/encfs.git
synced 2025-04-25 19:58:37 +02:00
rewrite C++11 check to look for basic classes
This commit is contained in:
parent
01d409b2d7
commit
b3355962ee
@ -1,4 +1,4 @@
|
|||||||
# ============================================================================
|
============================================================================
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
|
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
#
|
#
|
||||||
@ -37,30 +37,26 @@
|
|||||||
#serial 4
|
#serial 4
|
||||||
|
|
||||||
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
|
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
|
||||||
template <typename T>
|
// Checks that standard libraries are available.
|
||||||
struct check
|
#include <functional>
|
||||||
{
|
#include <memory>
|
||||||
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
#include <string>
|
||||||
};
|
|
||||||
|
|
||||||
struct Base {
|
using namespace std::placeholders;
|
||||||
virtual void f() {}
|
|
||||||
};
|
|
||||||
struct Child : public Base {
|
|
||||||
virtual void f() override {}
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef check<check<bool>> right_angle_brackets;
|
bool testFn(std::function<bool(int)> op) {
|
||||||
|
return op(42);
|
||||||
|
}
|
||||||
|
|
||||||
int a;
|
bool lenCheck(const std::shared_ptr<std::string> &str, int len) {
|
||||||
decltype(a) b;
|
return str->size() > len;
|
||||||
|
}
|
||||||
|
|
||||||
typedef check<int> check_type;
|
void check() {
|
||||||
check_type c;
|
std::shared_ptr<std::string> str(new std::string("hello world"));
|
||||||
check_type&& cr = static_cast<check_type&&>(c);
|
|
||||||
|
|
||||||
auto d = a;
|
testFn(std::bind(lenCheck, str, _1));
|
||||||
auto l = [](){};
|
}
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
|
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
|
||||||
|
Loading…
Reference in New Issue
Block a user