Skip to content

C++11 overhaul - Fixes #7, fixes #9#14

Open
TedLyngmo wants to merge 1 commit intoadedov:masterfrom
TedLyngmo:cpp11
Open

C++11 overhaul - Fixes #7, fixes #9#14
TedLyngmo wants to merge 1 commit intoadedov:masterfrom
TedLyngmo:cpp11

Conversation

@TedLyngmo
Copy link

This is meant as a co-op patch to make the library use and require C++11
or later. This is not a backwards compatible patch since it'll fail to
build in C++ versions prior to C++11.

  • TODO: Figure out how to make boost use std::iterator instead of its
    own iterator to get rid of the
    BOOST_HEADER_DEPRECATED("<iterator>") warning

@adedov
Copy link
Owner

adedov commented Oct 12, 2020

Ted,

Thank you! Will process this week.

@adedov
Copy link
Owner

adedov commented Oct 19, 2020

Can't build with Mac CLang C++:
c++ --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

[ 80%] Building CXX object tests/CMakeFiles/server-test.dir/test_server.cc.o
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:58:3: error: constructor for 'CallCountingInterceptor' must explicitly initialize the base class
'iqxmlrpc::Interceptor' which does not have a default constructor
CallCountingInterceptor(): count(0) {}
^
/Users/anton-dedov/personal/src/libiqxmlrpc/libiqxmlrpc/method.h:103:23: note: 'iqxmlrpc::Interceptor' declared here
class LIBIQXMLRPC_API Interceptor {
^
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:108:3: error: call to constructor of 'std::unique_ptr<Executor_factory_base>' is ambiguous
ef_(0),
^ ~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2466:13: note: candidate constructor [with _Dummy = true, $1 = void]
constexpr unique_ptr(nullptr_t) noexcept : _ptr(pointer()) {}
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2471:12: note: candidate constructor [with _Dummy = true, $1 = void]
explicit unique_ptr(pointer __p) noexcept : _ptr(__p) {}
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2494:3: note: candidate constructor
unique_ptr(unique_ptr&& __u) noexcept
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2401:28: note: candidate constructor (the implicit copy constructor) has been implicitly deleted
class LIBCPP_TEMPLATE_VIS unique_ptr {
^
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:109:3: error: call to constructor of 'std::unique_ptr' is ambiguous
impl
(0)
^ ~
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2466:13: note: candidate constructor [with _Dummy = true, $1 = void]
constexpr unique_ptr(nullptr_t) noexcept : _ptr(pointer()) {}
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2471:12: note: candidate constructor [with _Dummy = true, $1 = void]
explicit unique_ptr(pointer __p) noexcept : _ptr(__p) {}
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2494:3: note: candidate constructor
unique_ptr(unique_ptr&& _u) noexcept
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:2401:28: note: candidate constructor (the implicit copy constructor) has been implicitly deleted
class LIBCPP_TEMPLATE_VIS unique_ptr {
^
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:132:31: error: call to implicitly-deleted default constructor of 'LogInterceptor'
impl
->push_interceptor(new LogInterceptor);
^
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:24:23: note: default constructor of 'LogInterceptor' is implicitly deleted because base class
'iqxmlrpc::Interceptor' has no default constructor
class LogInterceptor: public Interceptor {
^
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:133:31: error: call to implicitly-deleted default constructor of 'TraceInterceptor'
impl
->push_interceptor(new TraceInterceptor);
^
/Users/anton-dedov/personal/src/libiqxmlrpc/tests/test_server.cc:33:25: note: default constructor of 'TraceInterceptor' is implicitly deleted because base class
'iqxmlrpc::Interceptor' has no default constructor
class TraceInterceptor: public Interceptor {
^
5 errors generated.
make[2]: *** [tests/CMakeFiles/server-test.dir/test_server.cc.o] Error 1
make[1]: *** [tests/CMakeFiles/server-test.dir/all] Error 2
make: *** [all] Error 2

@TedLyngmo
Copy link
Author

TedLyngmo commented Oct 19, 2020

Oups - I see I missed building the tests but I fixed it. It now compiles and runs all the tests OK for me.

@TedLyngmo TedLyngmo force-pushed the cpp11 branch 2 times, most recently from da450ab to 25a5941 Compare October 19, 2020 18:03
@TedLyngmo TedLyngmo force-pushed the cpp11 branch 2 times, most recently from 915b68d to 25a5941 Compare November 3, 2022 20:21
This is meant as a co-op patch to make the library use and require C++11
or later. This is not a backwards compatible patch since it'll fail to
build in C++ versions prior to C++11.

* TODO: Figure out how to make boost use std::iterator instead of its
  own iterator to get rid of the
  `BOOST_HEADER_DEPRECATED("<iterator>")` warning

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
@TedLyngmo
Copy link
Author

I just noticed this old patchset. Was there a problem with it? I hardly remember what made me put it up here. It must have been some code I used 2 years ago that used this library but I don't remember what it was :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants