Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why dividing core.h and core.cpp? #58

Open
awidesky opened this issue Jun 17, 2021 · 0 comments
Open

Why dividing core.h and core.cpp? #58

awidesky opened this issue Jun 17, 2021 · 0 comments

Comments

@awidesky
Copy link

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:

  1. Why put everything in header, so that let compiler compile the same definition in EVERY translation unit that include core.h?
  2. Why Matrix4::getDeterminant andcyclone::getSleepEpsilon, which is short function, in separated in .cpp file, while Matrix4::operator* , which is long function, is in header?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant