~ubuntu-branches/ubuntu/hardy/autoconf-archive/hardy

« back to all changes in this revision

Viewing changes to m4source/mni_cxx_have_koenig_lookup.m4

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2004-06-26 09:43:57 UTC
  • Revision ID: james.westby@ubuntu.com-20040626094357-3be3jwcz1vcdhpe8
Tags: upstream-20040616
ImportĀ upstreamĀ versionĀ 20040616

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl Available from the GNU Autoconf Macro Archive at:
 
2
dnl http://www.gnu.org/software/ac-archive/htmldoc/mni_cxx_have_koenig_lookup.html
 
3
dnl
 
4
AC_DEFUN([mni_CXX_HAVE_KOENIG_LOOKUP],
 
5
    [AC_CACHE_CHECK(whether the compiler implements Koenig lookup,
 
6
                    ac_cv_cxx_have_koenig_lookup,
 
7
                    [AC_LANG_PUSH(C++)
 
8
                     AC_TRY_COMPILE([
 
9
    namespace N1 {
 
10
        class C {};
 
11
        void f1(const C& c) {}
 
12
    }
 
13
 
 
14
    namespace N2 {
 
15
        void f2() {
 
16
            N1::C x;
 
17
            f1(x);     // resolves to N1::f1() if we have Koenig lookup,
 
18
                       // otherwise this will fail to compile.
 
19
        }
 
20
    }
 
21
    ],[],
 
22
                     ac_cv_cxx_have_koenig_lookup=yes,
 
23
                     ac_cv_cxx_have_koenig_lookup=no)
 
24
                     AC_LANG_POP])
 
25
    if test "$ac_cv_cxx_have_koenig_lookup" = yes; then
 
26
        AC_DEFINE(CXX_HAVE_KOENIG_LOOKUP,1,
 
27
                  [define to 1 if the compiler implements Koenig lookup])
 
28
    fi
 
29
])