Skip to content

Commit 30f47c6

Browse files
committed
possible fix for copy-constructor issue: move-constructor
1 parent 87be1ab commit 30f47c6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Diff for: Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ export MACOSX_DEPLOYMENT_TARGET=$(LIBVER)
33

44
CXX=clang++
55
CPPFLAGS += -MMD -MP
6-
CXXFLAGS += --std=c++20 -pedantic-errors -Weverything -Wno-c++98-compat -Wno-pre-c++20-compat-pedantic -Wno-poison-system-directories
6+
CXXFLAGS := --std=c++20
7+
EXTRA_CXXFLAGS := -pedantic-errors -Weverything -Wno-c++98-compat -Wno-pre-c++20-compat-pedantic -Wno-poison-system-directories
78
LDFLAGS += -Llib -fvisibility=default -fPIC
89
LDLIBS += -lgetargv
910

@@ -14,13 +15,13 @@ run: bin/main
1415
bin/main
1516

1617
lib/libgetargv++.dylib: obj/argv.o obj/argvargc.o | lib
17-
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -dynamiclib $^ -o $@
18+
$(CXX) $(EXTRA_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -dynamiclib $^ -o $@
1819

1920
bin/main: lib/libgetargv++.dylib obj/main.o | bin
20-
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -lgetargv++ -fPIE $^ -o $@
21+
$(CXX) $(EXTRA_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) $(LDLIBS) -lgetargv++ -fPIE $^ -o $@
2122

2223
obj/%.o: src/%.cpp | obj
23-
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $^ -o $@
24+
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS) -c $^ -o $@
2425

2526
bin lib obj:
2627
mkdir -p $@

Diff for: src/libgetargv++.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ 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-
1915
namespace Getargv {
2016

2117
struct Argv : protected ffi::ArgvResult {
@@ -27,6 +23,7 @@ struct Argv : protected ffi::ArgvResult {
2723
bool nuls) noexcept(false);
2824

2925
Argv(Argv &r) = delete;
26+
Argv(Argv &&r) = default;
3027
Argv(const ffi::ArgvResult &r);
3128
~Argv();
3229

@@ -46,6 +43,7 @@ struct ArgvArgc : protected ffi::ArgvArgcResult {
4643
static std::vector<std::string> as_string_array(pid_t pid) noexcept(false);
4744

4845
ArgvArgc(ArgvArgc &r) = delete;
46+
ArgvArgc(ArgvArgc &&r) = default;
4947
ArgvArgc(const ffi::ArgvArgcResult &r);
5048
~ArgvArgc();
5149

0 commit comments

Comments
 (0)