pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG #1589: The whole concept of forces/move_with_forces/forces_holde


From: Ingo Ruhnke
Subject: Re: BUG #1589: The whole concept of forces/move_with_forces/forces_holder > needs to be rethought
Date: 04 Nov 2002 23:21:08 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"Neil Mitchell" <address@hidden> writes:

> > This would result in the use of member templates, could somebody
> > confirm that MSVC6 supports them? As far as I know its only there STL
> > which is build without them.
> Send me code, I'll see if it works.

Here it goes:

#include <iostream>

class Pingu
{
public:
  template<class T>
  void check_collision(const T& col) 
  {
    if (col(6, 5))
      std::cout << "Something collided" << std::endl;
    else
      std::cout << "Nothing collided" << std::endl;
  }
};

struct Coll
{
  bool operator() (int a, int b) const {
    return a > b;
  }
};

int main()
{
  Pingu a;
  a.check_collision(Coll());
}

// EOF //

-- 
WWW:      http://pingus.seul.org/~grumbel/ 
Games:    http://pingus.seul.org/~grumbel/gamedesigns/
JabberID: address@hidden 
ICQ:      59461927




reply via email to

[Prev in Thread] Current Thread [Next in Thread]