Thread: missing template parameters? help!

  1. #1
    Prying open my third eye.
    Join Date
    Jun 2005
    Posts
    45

    missing template parameters? help!

    I am working on a project for a C++ class. We need to implement an abstract problem solver that can solve simple, yet different problems.

    I am doing this by creating a 'rule' class for each problem such that they define the specifics for each problem. The intention is to pass this class as a template parameter to a solver class.

    the solver class is defined:
    Code:
    template < class T >
    class Solver {
    //solver code
    //uses template parameter to call two simple functions
    }
    
    and in my main function:
    
    Solver::Solver< ClockPuzzle::ClockPuzzle > puzzle( goal, hours, time );
    
    puzzle.solve();
    The only error I am getting says I am creating Solver without a template parameter. I am a C programmer coming to C++ and I have stared at the code for hours...so I think I am missing some basic syntax/scoping issues.

    Any help would be greatly appreciated.
    "So you're one of those condescending UNIX computer users?"

    "Here's a nickel, kid. Get yourself a better computer."

  2. #2
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Code:
    Solver::Solver< ClockPuzzle::ClockPuzzle > puzzle( goal, hours, time );
    if Solver is in namespace Solver and ClockPuzzle is in namespace ClockPuzzle this could be right.
    but mybe it's just
    Code:
    Solver< ClockPuzzle > puzzle( goal, hours, time );
    Kurt

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. error: template with C linkage
    By michaels-r in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2006, 08:11 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM