dnl CF_CPP_OVERRIDE version: 2 updated: 2024/11/09 18:07:29
dnl ---------------
dnl Check if the C++ compiler accepts the override keyword.  This is a C++-11
dnl feature.
AC_DEFUN([CF_CPP_OVERRIDE],
[
if test -n "$CXX"; then
AC_CACHE_CHECK(if $CXX accepts override keyword,cf_cv_cpp_override,[
	AC_LANG_SAVE
	AC_LANG_CPLUSPLUS
	AC_TRY_RUN([

class base
{
public:
	virtual int foo(float x) = 0;
};


class derived: public base
{
public:
	int foo(float x) override { return x != 0.0 ? 1 : 0; }
};

int main(void) { }
],
	[cf_cv_cpp_override=yes],
	[cf_cv_cpp_override=no],
	[cf_cv_cpp_override=unknown])
	AC_LANG_RESTORE
])
fi
test "$cf_cv_cpp_override" = yes && AC_DEFINE(CPP_HAS_OVERRIDE,1,[Define to 1 if C++ has override keyword])
])dnl
