From e62c12d0c93db3a1da2bc25532ffbf23e41c6292 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Sat, 10 Oct 2020 20:20:59 +0200 Subject: [PATCH] Remove deprecated initialization via overloaded comma operator. This feature has been marked as deprecated since 1.7.0. There's been more than four years to switch to initializer lists. Let's hope people have modified their code since. --- ginac/container.h | 166 ---------------------------------------------- ginac/matrix.h | 67 ------------------- 2 files changed, 233 deletions(-) diff --git a/ginac/container.h b/ginac/container.h index 6909b743..6c312e74 100644 --- a/ginac/container.h +++ b/ginac/container.h @@ -68,63 +68,6 @@ template <> inline void container_storage::reserve(std::vector & v, size_t n) { v.reserve(n); } -/** Helper template to allow initialization of containers via an overloaded - * comma operator (idea stolen from Blitz++). */ -template -class container_init { -public: - container_init(STLT & s) : stlt(s) {} - - container_init operator,(const T & x) - { - stlt.push_back(x); - return container_init(stlt); - } - - // The following specializations produce much tighter code than the - // general case above - - container_init operator,(int x) - { - stlt.push_back(x); - return container_init(stlt); - } - - container_init operator,(unsigned int x) - { - stlt.push_back(x); - return container_init(stlt); - } - - container_init operator,(long x) - { - stlt.push_back(x); - return container_init(stlt); - } - - container_init operator,(unsigned long x) - { - stlt.push_back(x); - return container_init(stlt); - } - - container_init operator,(double x) - { - stlt.push_back(x); - return container_init(stlt); - } - - container_init operator,(const symbol & x) - { - stlt.push_back(T(x)); - return container_init(stlt); - } - -private: - container_init(); - STLT & stlt; -}; - /** Wrapper template for making GiNaC classes out of STL containers. */ template