KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can one in C++11 somehow in gcc mark a function (not a class method) as const telling that it is pure and does not use the global memory but only its arguments? I've tried gcc 's __attribute__((const)) and it is precisely what I want. But it does not produce any compile time error when the global memory is touched in the function. Edit 1 Please be careful . I mean pure functions. Not constant functions . GCC's attribute is a little bit confusing. Pure functions only use their arguments.
Tags (comma-separated)
Save Edits
Cancel