Skip to content

Instantly share code, notes, and snippets.

@fortheday
Created July 13, 2018 09:33
Show Gist options
  • Save fortheday/27e65298679e29f8c8fbc36def8be63a to your computer and use it in GitHub Desktop.
Save fortheday/27e65298679e29f8c8fbc36def8be63a to your computer and use it in GitHub Desktop.
#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