OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [memclass3.C] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/17132
2
 
3
template 
4
struct has_deref
5
{
6
    struct impl
7
    {
8
        template <
9
            typename Type,
10
            typename Type::reference (Type::*Func)(void) const>
11
        struct func_tag;
12
 
13
        template 
14
        static char (& test(
15
            Type *,
16
            func_tag * = 0
17
        ))[2];
18
        static char test(void *);
19
    };
20
 
21
    static const bool value = (sizeof(impl::test((T *) 0)) == 2);
22
};
23
 
24
template 
25
struct container
26
{
27
    struct iterator
28
    {
29
        typedef T & reference;
30
        reference operator*() const;
31
    };
32
};
33
 
34
int main()
35
{
36
    typedef container::iterator iter;
37
    int result = has_deref::value;
38
    return result;
39
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.