Like Tree1Likes
  • 1 Post By Salem

So here is a function declaration for a class template...

This is a discussion on So here is a function declaration for a class template... within the C++ Programming forums, part of the General Programming Boards category; Code: void inOrder ( void ( * ) ( T& )); A. What does the void part mean? B. Why ...

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    86

    So here is a function declaration for a class template...

    Code:
    void inOrder ( void ( * ) ( T& ));

    A. What does the void part mean?
    B. Why is the * and the T& enclosed in parenthesis?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,340
    The Function Pointer Tutorials - Index
    It looks something like inOrder takes a single function pointer as a parameter (*)
    That function (when called by inOrder) would be passed a reference to T, and return void.
    wildcard_seven likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    86
    Wow. Okay, it's starting to become clear.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 01-30-2011, 03:28 PM
  2. friend function template class declaration error
    By -EquinoX- in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2009, 12:00 PM
  3. Declaration of virtual class template list
    By benshi in forum C++ Programming
    Replies: 9
    Last Post: 02-02-2008, 05:12 PM
  4. Template function declaration error
    By jaw24 in forum C++ Programming
    Replies: 9
    Last Post: 06-12-2007, 08:42 PM
  5. Replies: 2
    Last Post: 04-06-2005, 07:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21