Difference between revisions of "Intermediate C++ Game Programming Tutorial 14"

From Chilipedia
Jump to: navigation, search
(Created page with "In this tutorial we learn how to make our own goddamn templates. Drunk with power, we are. Also functors, which are pretty sweet and an integral part of the standard library....")
 
(Notes)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
In this tutorial we learn how to make our own goddamn templates. Drunk with power, we are. Also functors, which are pretty sweet and an integral part of the standard library.
+
In this tutorial we learn how to make our own goddamn templates. So much power. Drunk with it we are. We also learn about the concept of a "functor" (dumb name, clever idea), which is pretty sweet and an integral part of the standard library.
  
 
== Topics Covered ==
 
== Topics Covered ==
Line 13: Line 13:
 
== Source Code ==
 
== Source Code ==
 
[https://github.com/planetchili/sprite Sprite Repo]
 
[https://github.com/planetchili/sprite Sprite Repo]
 +
 +
== Notes ==
 +
For the template aliases, instead of <code>typedef Vec2_<int> Vei2;</code>, an alternative syntax is available in C++11 in the form of: <code>using Vei2 = Vec2_<int>;</code>.
  
 
== Homework ==
 
== Homework ==

Latest revision as of 11:50, 26 September 2017

In this tutorial we learn how to make our own goddamn templates. So much power. Drunk with it we are. We also learn about the concept of a "functor" (dumb name, clever idea), which is pretty sweet and an integral part of the standard library.

Topics Covered

  • Class template
  • Function template
  • Functors
  • typedef
  • Template parameter deduction

Video Timestamp Index

Tutorial 14

Source Code

Sprite Repo

Notes

For the template aliases, instead of typedef Vec2_<int> Vei2;, an alternative syntax is available in C++11 in the form of: using Vei2 = Vec2_<int>;.

Homework

No homework.

See also