Created
July 13, 2018 09:33
-
-
Save fortheday/27e65298679e29f8c8fbc36def8be63a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma warning(disable : 4710 4514) | |
#include <stdio.h> | |
#include <errno.h> | |
class CMutable | |
{ | |
private: | |
mutable int m_Val = 0; | |
public: | |
int Increase() const { return m_Val++; } | |
}; | |
void TestMutable() | |
{ | |
CMutable m; | |
for(errno=3;errno--;) | |
printf("mutable.GetIntValue[%d]\n", m.Increase()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment