Samuel-Tyler / fast_ber

A C++11 ASN.1 BER Encoding and Decoding Library
Boost Software License 1.0
84 stars 11 forks source link

Add support of c++17 standard #13

Closed melg8 closed 4 years ago

melg8 commented 4 years ago

When changing in CMakeLists.txt cxx standard in cmake like this: set(CMAKE_CXX_STANDARD 17) And compiling with:

gcc (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0

On latest devel commit Observe an error in choice.hpp:55:

fast_ber/ber_types/Choice.hpp:55: error: ‘VisitResult’ in namespace ‘absl::variant_internal’ does not name a template type
 absl::variant_internal::VisitResult<Visitor, Choice<Variants...>> visit(Visitor&&                  vis,
                         ^~~~~~~~~~~

I think it happens because absl fallback to std implementation of visit and variant when c++17 is enabled (look for ABSL_USES_STD_VARIANT). So basically variant_internal::VisitResult doesn't exists in that case.

I don't know best solution, but what i can suggest:

Off topic: i think it will be great to add some checks to ci - to prevent any regression in standard support.

Samuel-Tyler commented 4 years ago

Thank you for the report. I'll take a look at this after work.

Adding coverage for more compilers is a great idea.

Samuel-Tyler commented 4 years ago

I've fixed the build for 17, and added g++-7 and clang++-7 to Travis.

melg8 commented 4 years ago

Great! Thanks for fast response.