Skip to content

Compilation on G++ 4.6.3 #4

@zoltanp

Description

@zoltanp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions