Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation on G++ 4.6.3 #4

Open
zoltanp opened this issue Jun 20, 2013 · 1 comment
Open

Compilation on G++ 4.6.3 #4

zoltanp opened this issue Jun 20, 2013 · 1 comment
Labels

Comments

@zoltanp
Copy link

zoltanp commented Jun 20, 2013

Hi,

apparently it is possible to use the library on older G++, like version 4.6.3 included in Ubuntu 12.04 LTS, by applying a minor fix; I'm pasting it here in case it is useful for anybody.

@thejohnfreeman Feel free to close this issue as wontfix, because old compilers generally won't support c++11 properly.

Index: autocheck/include/autocheck/value.hpp
===================================================================
--- autocheck/include/autocheck/value.hpp   (original)
+++ autocheck/include/autocheck/value.hpp   (new)
@@ -12,15 +12,15 @@
         None,
         Static,
         Heap
-      }    allocation = None;
+      }   allocation /* = None */;

       union {
-        T* pointer = nullptr;
+        T* pointer /* = nullptr */;
         T  object;
       };

     public:
-      value() {}
+      value() : allocation(None), pointer(nullptr) {}

       value(const value& copy) { *this = copy; }

Although complex code, like generators for classes and enums, seems to break the compiler, the autocheck library is still very useful on pre-c++11 compilers.

@thejohnfreeman
Copy link
Owner

Thank you! I'll leave it up for the time being so people will be more likely to see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants