Tag: overloading
5 posts
-
C++ Name Hiding: Why a Derived Function Hides Base Overloads and How using Fixes It
Why a derived-class function hides every base-class overload with the same name, why the dangerous case compiles and silently calls the wrong function, and how using-declarations and -Woverloaded-virtual prevent it.
-
C++ Default Arguments: Rules, Virtual Function Traps, and API Design
How C++ default arguments work: trailing-only rules, header vs .cpp placement, call-site substitution, overload ambiguity, and the virtual function trap.
-
C++ initializer_list Constructors: Why Braces Pick Them, and How That Breaks Overloads
How std::initializer_list constructors take priority in brace initialization, why vector{3, 7} has two elements, {{}} vs ({}), move-only elements, dangling lists, and API design rules.
-
C++ Function Overloading: Rules, Ambiguity, and Name
Why return type never disambiguates overloads, why float(10.0f) is not actually ambiguous between int and double, and how default arguments and const-qualified members interact with overload resolution.
-
C++ Name Mangling: Reading _Z Symbols, extern "C", and Link Errors
How C++ compilers encode namespaces, overloads, const and templates into symbols, reading them with nm and c++filt, and when extern "C" fixes link errors.