First, it's more a question from c++ beginner, not a big report or something, not sure if this is acceptable, but please let me give it a shot :)
In core.h, there's almost every definition of class member functions, except for something like Matrix4::getDeterminant or Matrix4::setInverse functions.
I learned "everything in header" approach make member functions implicitly "inline",
BUT that "inline" means nothing about optimization, but just a sign that let multiple definition of a member function exist.
So I wish someone could let me know about:
Why put everything in header, so that let compiler compile the same definition in EVERY translation unit that include core.h?
Why Matrix4::getDeterminant andcyclone::getSleepEpsilon, which is short function, in separated in .cpp file, while Matrix4::operator*, which is long function, is in header?
First, it's more a question from c++ beginner, not a big report or something, not sure if this is acceptable, but please let me give it a shot :)
In core.h, there's almost every definition of class member functions, except for something like
Matrix4::getDeterminant
orMatrix4::setInverse
functions.I learned "everything in header" approach make member functions implicitly "inline", BUT that "inline" means nothing about optimization, but just a sign that let multiple definition of a member function exist.
So I wish someone could let me know about:
core.h
?Matrix4::getDeterminant
andcyclone::getSleepEpsilon
, which is short function, in separated in .cpp file, whileMatrix4::operator*
, which is long function, is in header?