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

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    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.
    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.

  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, 04:28 PM
  2. friend function template class declaration error
    By -EquinoX- in forum C++ Programming
    Replies: 2
    Last Post: 11-20-2009, 01:00 PM
  3. Declaration of virtual class template list
    By benshi in forum C++ Programming
    Replies: 9
    Last Post: 02-02-2008, 06: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