Topic: Proposal: Nested INLINE (function | functors)


Author: "Philippe A. Bouchard" <philippeb@videotron.ca>
Date: Mon, 11 Feb 2002 19:20:46 GMT
Raw View
.... I'm sorry to bother you guys with this again, but I think my idea is
worth it in this case.

What would you say if the 'inline' keyword would become a deterministic
keyword in nested classes or functions (therefore virtual, recursive or too
much complex functions rejected)?

It would be great here:

template <typename _T>
    void foo(_T const & t)
    {
        t();
    }

int main()
{
    int i;

    inline bool f() { return i == 1; }

    struct
    {
        inline bool operator()() { return i == 2; }
    } s;

    foo(f); // 'inline' would be needed in order to be accepted
    foo(s); // 'inline' of operator() would be needed to be accepted
}


Thanks,
Philippe


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]