General C++ Programming - October 2024

what does T = 0 mean in a template parameter?
 
What does T = 0 mean in the following code: template<typename T, T = 0> T moduloOf(T a, T b) { return a % b; }
[4 replies] Last: Indeed: "initialized with value 0" limit what type the T can be? (by JUANDENT)
When does early binding happen?
 
Thing 1: Static binding takes place during compilation - function calls are replaced with an instruction saying "go here for the appropriate function definit...
[1 reply] : I guess this is what's called "devirtualization" which GCC has optimiz... (by Peter87)
Would like some testers please
 
Sorry is this is the wrong forum. If possible I would like someone to try out my program. It works for me but I want to know if it works for other people. ...
[10 replies] Last: There's a special GitHub repo set up to make it easy to learn how to f... (by deleted account xyzzy)
_Safe_add checks for overflow but does not do anything to report the problem!
 
Looking at VC++ source files I find in ratio the following: what is the purpose of _Safe_add_integer_arithmetic_overflow_error? inline void _Safe...
[5 replies] Last: Neat example, thanks. (by Ganado)
templates class friends strong types
 
Hello all, first a bit of background. Land Surveying involves many types of: Angles, Bearings; Distances; Co-ordinates; and there are many types adjustments ...
[8 replies] Last: I read Jonathon Boccara's blog That article is from 2016, C++20's co... (by deleted account xyzzy)
  Archived months: [sep2024]

This is an archived page. To post a new message, go to the current page.