nfprojects / nfengine

Game engine
GNU General Public License v2.0
55 stars 4 forks source link

Change all typedef's for using #177

Closed mkulagowski closed 8 years ago

mkulagowski commented 8 years ago

Cpp11 gives us a LOT of wonderful and useful things. One of them is using, which is somewhat of an upgraded typedef.

  1. It looks neater
  2. It helps in avoiding not-type-::type pitfall in templates
  3. It does not require typename, when used in templates

In recognition for great addition, that is using, we need to swap all typedef with using.

mkulagowski commented 8 years ago

I checked typedefs used in project and got additional task for this issue: All function types constructed using std::function should be substituted for C-style function types, reason being an overhead of std::function. Little as it may be, it still is an overhead. If we're not using std::bind and other such utilities, we have no need for std::function.

Moreover it would be best to actually use closures instead of function pointers - I've heard that, they're even faster than C-style function ptrs (actually WOW!).

Witek902 commented 8 years ago

How you want to replace std::function with C-style functions if we are using std::bind? How can be something faster that C-style function pointer?

lookeypl commented 8 years ago

Looks like the idea is redundant. Closing.