1
0
mirror of https://github.com/OlafvdSpek/ctemplate.git synced 2025-10-05 19:16:54 +08:00

MSVC supports mutable on structs

This commit is contained in:
Olaf van der Spek 2017-01-22 14:39:02 +01:00
parent cd8dc4a228
commit 1ba73fa183

View File

@ -122,14 +122,7 @@ struct @ac_windows_dllexport@ StaticTemplateString {
// These members shouldn't be accessed directly, except in the // These members shouldn't be accessed directly, except in the
// internals of the template code. They are public because that is // internals of the template code. They are public because that is
// the only way we can brace-initialize them. NOTE: MSVC (at least // the only way we can brace-initialize them.
// up to 8.0) has a bug where it ignores 'mutable' when it's buried
// in an internal struct. To fix that, we have to make this whole
// internal struct mutable. We only do this on MSVC, so on other
// compilers we get the full constness we want.
#ifdef _MSC_VER
mutable
#endif
struct { struct {
const char* ptr_; const char* ptr_;
size_t length_; size_t length_;