public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46719] New: Cannot call C++0x variadic function template
@ 2010-11-30  7:20 eplawless+gcc at gmail dot com
  2010-11-30 10:57 ` [Bug c++/46719] [C++0x] Cannot call " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: eplawless+gcc at gmail dot com @ 2010-11-30  7:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46719

           Summary: Cannot call C++0x variadic function template
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eplawless+gcc@gmail.com


The following function template compiles without issue:

    template <typename Return, typename FirstType, typename... ArgTypes>
    function<Return(ArgTypes...)>
    curry(function<Return(FirstType,ArgTypes...)> func, FirstType arg)
    {
        return [func, arg](ArgTypes... args) -> Return {
            return func(arg, args...);
        };
    }

But as soon as I try to call it, like so:

    int main()
    {
        cout << curry([](int x) -> double {
            return static_cast<double>(x);
        }, 10)();
        return 0;
    }

It throws the following error:

    error: no matching function for call to ‘curry(main()::<lambda(int)>, int)’

The version of G++ used was:

    g++ (GCC) 4.6.0 20101113 (experimental)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-12-01  3:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-30  7:20 [Bug c++/46719] New: Cannot call C++0x variadic function template eplawless+gcc at gmail dot com
2010-11-30 10:57 ` [Bug c++/46719] [C++0x] Cannot call " redi at gcc dot gnu.org
2010-11-30 11:18 ` paolo.carlini at oracle dot com
2010-11-30 20:27 ` flast at flast dot jp
2010-11-30 20:32 ` redi at gcc dot gnu.org
2010-11-30 23:08 ` redi at gcc dot gnu.org
2010-11-30 23:26 ` eplawless+gcc at gmail dot com
2010-12-01  0:31 ` flast at flast dot jp
2010-12-01  1:51 ` redi at gcc dot gnu.org
2010-12-01  2:59 ` eplawless+gcc at gmail dot com
2010-12-01  3:00 ` eplawless+gcc at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).