blob: 95a9951eb346c6fe095b15814d618bb3cd89f0f8 [file] [log] [blame]
Austin Schuh906616c2019-01-21 20:25:11 -08001AC_DEFUN([AC_CXX_USING_OPERATOR],
2 [AC_CACHE_CHECK(
3 whether compiler supports using ::operator<<,
4 ac_cv_cxx_using_operator,
5 [AC_LANG_SAVE
6 AC_LANG_CPLUSPLUS
7 AC_TRY_COMPILE([#include <iostream>
8 std::ostream& operator<<(std::ostream&, struct s);],
9 [using ::operator<<; return 0;],
10 ac_cv_cxx_using_operator=1,
11 ac_cv_cxx_using_operator=0)
12 AC_LANG_RESTORE])
13 if test "$ac_cv_cxx_using_operator" = 1; then
14 AC_DEFINE(HAVE_USING_OPERATOR, 1, [define if the compiler supports using expression for operator])
15 fi])