I’m writing a simple wrapper in C++ around GLFW and OpenGL, as an exercice. I have a class Window and a class Renderer. The Window class owns a Renderer member. Window sets the GLFW context in its constructor and run the main loop, and call for its Renderer member to draw. Renderer sets the buffers ..
Category : abstraction
Situation I am writing an abstract (not in the "abstract class" or "pure virtual functions" sense) function, class, library, whatsoever and need certain functionality of types. These types are provided by many libraries, though the implementation of the specific method might be named differently. Question How do I adapt the libraries to the interface I ..
I have the following function that I use multiple times in my class for abstraction: void Interpreter::pushToStack(int value) { stack.push_back(std::to_string(value)); } Now I have a certain function where I do this: stack.push_back(stack.back()); Is this bad practice? Is it bad to not be consistent in using abstraction functions? Because I think I can’t really use pushToStack(int) ..
In C++, I have a class that contains two members which are sorted containers. The containers store the same kind of object, but one is sorted in ascending order and the other in descending order. I have several template methods which visit items in a container, with the template argument saying which container to visit ..
Recent Comments