diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 32d8713ba..fca6be9b3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -81,6 +81,24 @@ jobs: run: | cd build ./test/run_tests "~[quality]" + build-gcc10-cpp20: + runs-on: ubuntu-latest + name: GNU GCC 10 (c++20) + + steps: + - uses: actions/checkout@v1 + with: + submodules: true + - name: Build mockturtle + run: | + mkdir build + cd build + cmake -DMOCKTURTLE_CXX_STANDARD=20 -DCMAKE_CXX_COMPILER=g++-10 -DMOCKTURTLE_TEST=ON .. + make run_tests + - name: Run tests + run: | + cd build + ./test/run_tests "~[quality]" build-clang8: runs-on: ubuntu-latest name: Clang 8 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b91c4c16..eabbc1ea1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.8) project(mockturtle LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) +set(MOCKTURTLE_CXX_STANDARD "17" CACHE STRING "C++ standard") +set(CMAKE_CXX_STANDARD ${MOCKTURTLE_CXX_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Options diff --git a/include/mockturtle/networks/aig.hpp b/include/mockturtle/networks/aig.hpp index 416763643..cb06537f6 100644 --- a/include/mockturtle/networks/aig.hpp +++ b/include/mockturtle/networks/aig.hpp @@ -167,6 +167,13 @@ class aig_network { return {index, complement}; } + +#if __cplusplus > 201703L + bool operator==( aig_storage::node_type::pointer_type const& other ) const + { + return data == other.data; + } +#endif }; aig_network() diff --git a/include/mockturtle/networks/mig.hpp b/include/mockturtle/networks/mig.hpp index 3a275f3a2..34119ef52 100644 --- a/include/mockturtle/networks/mig.hpp +++ b/include/mockturtle/networks/mig.hpp @@ -150,6 +150,13 @@ class mig_network { return {index, complement}; } + +#if __cplusplus > 201703L + bool operator==( mig_storage::node_type::pointer_type const& other ) const + { + return data == other.data; + } +#endif }; mig_network() diff --git a/include/mockturtle/networks/xag.hpp b/include/mockturtle/networks/xag.hpp index 9d104655a..0193f6579 100644 --- a/include/mockturtle/networks/xag.hpp +++ b/include/mockturtle/networks/xag.hpp @@ -164,6 +164,13 @@ class xag_network { return {index, complement}; } + +#if __cplusplus > 201703L + bool operator==( xag_storage::node_type::pointer_type const& other ) const + { + return data == other.data; + } +#endif }; xag_network() diff --git a/include/mockturtle/networks/xmg.hpp b/include/mockturtle/networks/xmg.hpp index 17af7b93a..7fd92a5b9 100644 --- a/include/mockturtle/networks/xmg.hpp +++ b/include/mockturtle/networks/xmg.hpp @@ -149,6 +149,13 @@ class xmg_network { return {index, complement}; } + +#if __cplusplus > 201703L + bool operator==( xmg_storage::node_type::pointer_type const& other ) const + { + return data == other.data; + } +#endif }; xmg_network()