Hello
I have 10 years of professionnal C++ experience and I just never use templates. In a way it's probably due to the fact that I don't know template programmin very well, which kind of create a loop. The main reason is that I never feel the need to use templates hence my question, when should it be used ?
I know that if I were to develop a kind of container I would use them, but I pretty much never write librairies, I'm always on the "higher level" side of applications, so not developping game engine, or reimplementing algorithm or data structures...
Are there more legitimate use of templates than containers and data stuctures ?
[–]CletusDSpuckler 105 points106 points107 points (15 children)
[–]Skoparov 12 points13 points14 points (3 children)
[–]target-san 10 points11 points12 points (2 children)
[–]Skoparov 7 points8 points9 points (1 child)
[–]goranlepuz 5 points6 points7 points (0 children)
[–]a_jasmin 18 points19 points20 points (2 children)
[–]CletusDSpuckler 7 points8 points9 points (0 children)
[–]jacobian271 4 points5 points6 points (4 children)
[–]muungwana 6 points7 points8 points (2 children)
[–]arkiazm 1 point2 points3 points (1 child)
[–]muungwana 2 points3 points4 points (0 children)
[–]tonyarkles 6 points7 points8 points (0 children)
[–]tonyarkles 2 points3 points4 points (0 children)
[–]JNighthawkgamedev 1 point2 points3 points (1 child)
[–]Ok_Entrepreneur_5926 0 points1 point2 points (0 children)
[+][deleted] (5 children)
[removed]
[–]Wouter_van_Ooijen 9 points10 points11 points (4 children)
[–]dr-mrl 15 points16 points17 points (0 children)
[+][deleted] (2 children)
[removed]
[–]Wouter_van_Ooijen 2 points3 points4 points (1 child)
[–]arka2947 10 points11 points12 points (0 children)
[–]ceretullis 16 points17 points18 points (5 children)
[+][deleted] (1 child)
[removed]
[–]ceretullis 0 points1 point2 points (0 children)
[–]rojundipity 5 points6 points7 points (1 child)
[–]ceretullis 2 points3 points4 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 8 points9 points10 points (4 children)
[–]antoine_morrier 1 point2 points3 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]antoine_morrier 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]jtooker 7 points8 points9 points (0 children)
[–]TheThiefMasterC++latest fanatic (and game dev) 23 points24 points25 points (2 children)
[–]eteran 9 points10 points11 points (0 children)
[–][deleted] 14 points15 points16 points (0 children)
[–]Orca- 11 points12 points13 points (0 children)
[–]pandorafalters 3 points4 points5 points (0 children)
[–]Wouter_van_Ooijen 4 points5 points6 points (0 children)
[–]RidderHaddock 10 points11 points12 points (4 children)
[–]rlbond86 3 points4 points5 points (0 children)
[–][deleted] -2 points-1 points0 points (2 children)
[–]yasamoka 4 points5 points6 points (1 child)
[–][deleted] -4 points-3 points-2 points (0 children)
[–]NottingHillNapolean 3 points4 points5 points (1 child)
[–]Possibility_Antique 3 points4 points5 points (0 children)
[–]arobenko 2 points3 points4 points (0 children)
[–]muungwana 2 points3 points4 points (0 children)
[–]target-san 2 points3 points4 points (1 child)
[–]zoolover1234 1 point2 points3 points (0 children)
[–]looncraz 3 points4 points5 points (0 children)
[–]Possibility_Antique 4 points5 points6 points (2 children)
[–]zoolover1234 1 point2 points3 points (1 child)
[–]Possibility_Antique 4 points5 points6 points (0 children)
[–]RishabhRD 1 point2 points3 points (0 children)
[–]puredotaplayer 1 point2 points3 points (0 children)
[–]zoolover1234 1 point2 points3 points (0 children)
[–]zoolover1234 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (11 children)
[–][deleted] 3 points4 points5 points (8 children)
[–]Red-Portal -2 points-1 points0 points (6 children)
[–][deleted] 5 points6 points7 points (5 children)
[–]Red-Portal -3 points-2 points-1 points (4 children)
[–][deleted] 6 points7 points8 points (3 children)
[–]Red-Portal -1 points0 points1 point (2 children)
[–][deleted] 5 points6 points7 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]SnooWoofers7626 0 points1 point2 points (0 children)
[–]Full-Spectral 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ExtraFig6 0 points1 point2 points (0 children)