Category : attributes

I have a constructor GameObject::GameObject(Node body){ _body = body; glm::vec3 position = glm::vec3(0.0f, 0.0f, 0.0f); glm::vec3 velocity = glm::vec3(0.0f, 1.0f, 0.0f); }; and a member function void GameObject::update(float dt) { this->position = this->position + this->velocity * dt; } After calling the constructor, I call the update function on the same object. GameObject* go_water = new ..

Read more

I just ran through this docs for gcc but unfortunately when i am trying to implement it on my vscode it just ignores it totally….. #include<iostream> using namespace std; __attribute__((access(read_only,1))) void prt(int a){ a += 1; // expected a error std::cout << a << std::endl; } int main(){ prt(8); return 0; } can anybody help ..

Read more

If a variable is only used in an assert, then compilers usually produce a warning when the program is compiled in release mode (i.e. without debug flags). This question suggests ways to disable these particular warnings. Among the answers, the C++17 attribute maybe_unused is suggested. However, these answers have not really been discussed. Are there ..

Read more