Skip to content

Commit 87be1ab

Browse files
committed
warn about c++ < 17
c++17 allows you to return a struct from a function without the copy constructor, we cannot allow the copy contructor because the backing buffer is not duplicated when the struct is copied so it gets double freed.
1 parent e46440f commit 87be1ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libgetargv++.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ namespace ffi {
1212

1313
// TODO: tests
1414

15+
#if defined(__cplusplus) && (__cplusplus < 201703L)
16+
#error "C++ versions less than C++17 are not supported."
17+
#endif
18+
1519
namespace Getargv {
1620

1721
struct Argv : protected ffi::ArgvResult {

0 commit comments

Comments
 (0)