Skip to content

Commit 65933e3

Browse files
author
Benno Evers
committed
Officially require C++11.
As it turns out, support for building with a c++98 compiler was broken several months (years?) ago, but nobody noticed so far. This commit updates the README and header file to officially document that situation.
1 parent c19e00c commit 65933e3

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int main()
6565

6666
![Basic example](./examples/basic.png)
6767

68-
matplotlib-cpp doesn't require C++11, but will enable some additional syntactic sugar when available:
68+
Alternatively, matplotlib-cpp also supports some C++11-powered syntactic sugar:
6969
```cpp
7070
#include <cmath>
7171
#include "matplotlibcpp.h"
@@ -186,6 +186,16 @@ find_package(PythonLibs 2.7)
186186
target_include_directories(myproject PRIVATE ${PYTHON_INCLUDE_DIRS})
187187
target_link_libraries(myproject ${PYTHON_LIBRARIES})
188188
```
189+
190+
# C++11
191+
192+
Currently, c++11 is required to build matplotlib-cpp. The last working commit that did
193+
not have this requirement was `717e98e752260245407c5329846f5d62605eff08`.
194+
195+
Note that support for c++98 was dropped more or less accidentally, so if you have to work
196+
with an ancient compiler and still want to enjoy the latest additional features, I'd
197+
probably merge a PR that restores support.
198+
189199
# Python 3
190200

191201
This library supports both python2 and python3 (although the python3 support is probably far less tested,

matplotlibcpp.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
#include <algorithm>
77
#include <stdexcept>
88
#include <iostream>
9-
#include <stdint.h> // <cstdint> requires c++11 support
10-
11-
#if __cplusplus > 199711L || _MSC_VER > 1800
12-
# include <functional>
13-
#endif
9+
#include <cstdint> // <cstdint> requires c++11 support
10+
#include <functional>
1411

1512
#include <Python.h>
1613

@@ -1394,8 +1391,7 @@ inline void tight_layout() {
13941391
Py_DECREF(res);
13951392
}
13961393

1397-
#if __cplusplus > 199711L || _MSC_VER > 1800
1398-
// C++11-exclusive content starts here (variadic plot() and initializer list support)
1394+
// Support for variadic plot() and initializer lists:
13991395

14001396
namespace detail {
14011397

@@ -1524,6 +1520,4 @@ inline bool plot(const std::vector<double>& x, const std::vector<double>& y, con
15241520
return plot<double>(x,y,keywords);
15251521
}
15261522

1527-
#endif
1528-
15291523
} // end namespace matplotlibcpp

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy