]> www.ginac.de Git - ginac.git/blobdiff - ginac/registrar.h
[build] Install compiler.h header file.
[ginac.git] / ginac / registrar.h
index 5e2b0e49fbd18e71d658b517e1fee26321533efe..1c30253497b8c650e8c254d44eb8b53039a6b670 100644 (file)
@@ -3,7 +3,7 @@
  *  GiNaC's class registrar (for class basic and all classes derived from it). */
 
 /*
- *  GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2016 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -149,9 +149,14 @@ public: \
  *  registry (mainly needed for archiving). */
 #define GINAC_DECLARE_REGISTERED_CLASS(classname, supername) \
        GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(classname, supername) \
+       template<class B, typename... Args> friend B & dynallocate(Args &&... args); \
 public: \
        classname(); \
-       classname * duplicate() const override { return new classname(*this); } \
+       classname * duplicate() const override { \
+               classname * bp = new classname(*this); \
+               bp->setflag(status_flags::dynallocated); \
+               return bp; \
+       } \
        \
        void accept(GiNaC::visitor & v) const override \
        { \