Answer the question
In order to leave comments, you need to log in
Is it a good solution to split a large class into multiple .cpp files (C++)?
Let's say I have an Example class . Its header is declared in the Example.hpp file . But if I create an Example.cpp file (as is usually done) and write in it the implementation of all the functions declared in the Example.hpp file , then the resulting file can grow to several thousand lines, which is not very readable.
Is something like this a good solution?
Answer the question
In order to leave comments, you need to log in
Before the advent of the IDE, this could be considered a solution.
Now - no one needs and even an interfering crutch.
Actually, a class for thousands of lines is not a problem in itself.
But the fact that I want to scatter it over five files is a clear hint that refactoring is required to simplify the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question