From f7fd73214d2d0219483cd8979b220ed8a9453c56 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 5 Mar 2025 22:57:50 +0100 Subject: [PATCH 01/13] ci: update CI bundles to have a C++17-aware MOAB --- .gitlab/ci/download_superbuild.cmake | 16 ++++++++-------- .gitlab/os-linux.yml | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.gitlab/ci/download_superbuild.cmake b/.gitlab/ci/download_superbuild.cmake index ee5e245c2b..801387737f 100644 --- a/.gitlab/ci/download_superbuild.cmake +++ b/.gitlab/ci/download_superbuild.cmake @@ -7,17 +7,17 @@ cmake_minimum_required(VERSION 3.12) set(data_host "https://data.kitware.com") -# Determine the tarball to download. ci-smtk-ci-developer-{date}-{git-sha}.tar.gz -# 20250105 - Update to use Xcode 16.1 +# Determine the tarball to download. ci-smtk-ci-developer-{date}-{git-sha}-{platform}.tar.gz +# 20250305 - Update to MOAB with C++17 compat if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2022") - set(file_id "1fv29BZW5MedtbwV_-XuvGFNYHNFLdVxm") - set(file_hash "7d0919c3217e143c4be6f4e7c4e47e5b9831858efc0a406f7531d09d091243fb5be44bc7ed7e26a4c61d81a5e57f38a453c253dcc8037d3ffe0fb7c9b09ba77f") + set(file_id "1yh4aAKx-V3vul07YlBHcjw5o3TPq4KUk") + set(file_hash "070f1c176c7db85eed3c22d9d1dd53c1dacd1de2156120f51c17806bf59f705d60aaa1bf6bf3087019d0421b4ca1b71345f41f05ec26cbd5733d3671bd81c2e3") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos_x86_64") - set(file_id "1q_yl0ZXBzXZu27CqH0RJIggUO0dcdzxz") - set(file_hash "a8cd9a32216b5c1153b1a37ff672941302004a64e066192288727c4b6be5c2fd6c57a818b9254c0d7aed5e8ed26bdd357d54224ce503468ed34b8352315f6138") + set(file_id "1uYwTX1C6pbBja_smvkGJNCOBWM-WvgFz") + set(file_hash "4b6305631f02daf3443703d27e038b385611f0f7f89b319d2093807297a90780e232f34b1fac895ed22dc4de56a9e837e6befabb2a38c64a90321303d10b9c1f") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos_arm64") - set(file_id "1BluXPsmfRNqAqSpYahyvC6iWAVlJ0vzy") - set(file_hash "8e8a2f8492cc383658028184a25cd555f85697e2a0075c0792321de7980eda58e7b60c0ef5be743f253d44f5abaebf89852a606a90078214bb9eed885428ce73") + set(file_id "1-TmoPhfF71TeXaI62vZ9aOHvKmeRN2t7") + set(file_hash "dc08efb27412284c413e00c45e20cf037d906ca76a6e35021d9ba3fb26679cbdea46b8273bfbe6a448b524f78f19d70a5a5a99a8636714e7ad56f5313158a7c4") else () message(FATAL_ERROR "Unknown build to use for the superbuild") diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index f990fd6e30..a1b6a3572e 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -6,8 +6,8 @@ ### Fedora .fedora41: - # Update to Fedora 41 - image: "kitware/cmb:ci-smtk-fedora41-20250226" + # Update to MOAB with C++17 compat + image: "kitware/cmb:ci-smtk-fedora41-20250305" variables: GIT_SUBMODULE_STRATEGY: recursive @@ -67,14 +67,14 @@ .fedora41_vtk_python3: extends: .fedora41 - image: "kitware/cmb:ci-smtk-fedora41-vtk-20250226" + image: "kitware/cmb:ci-smtk-fedora41-vtk-20250305" variables: CMAKE_CONFIGURATION: fedora41_vtk_python3 .fedora41_paraview: extends: .fedora41 - image: "kitware/cmb:ci-smtk-fedora41-paraview-20250226" + image: "kitware/cmb:ci-smtk-fedora41-paraview-20250305" variables: CMAKE_CONFIGURATION: fedora41_paraview -- GitLab From f935051be253d395457d8cc10004e2496f248da7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 14:47:22 +0100 Subject: [PATCH 02/13] tutorials: request C++17 --- doc/tutorials/create_a_project/CMakeLists.txt | 2 +- doc/tutorials/implement_an_operator/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/tutorials/create_a_project/CMakeLists.txt b/doc/tutorials/create_a_project/CMakeLists.txt index 6911c0fc3a..62620f6915 100644 --- a/doc/tutorials/create_a_project/CMakeLists.txt +++ b/doc/tutorials/create_a_project/CMakeLists.txt @@ -1,7 +1,7 @@ project(create_a_project) cmake_minimum_required(VERSION 3.12) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_EXTENSIONS False) diff --git a/doc/tutorials/implement_an_operator/CMakeLists.txt b/doc/tutorials/implement_an_operator/CMakeLists.txt index ab548dd5db..99f745ab0c 100644 --- a/doc/tutorials/implement_an_operator/CMakeLists.txt +++ b/doc/tutorials/implement_an_operator/CMakeLists.txt @@ -1,7 +1,7 @@ project(ex_implement_an_operator) cmake_minimum_required(VERSION 3.12) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_EXTENSIONS False) -- GitLab From 36e8a25d1ed3e363c5ffff9d8c67ba884c5838c2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 14:48:42 +0100 Subject: [PATCH 03/13] smtk: use C++17 as part of the library --- smtk/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smtk/CMakeLists.txt b/smtk/CMakeLists.txt index d18dc902f3..f881020364 100644 --- a/smtk/CMakeLists.txt +++ b/smtk/CMakeLists.txt @@ -126,6 +126,9 @@ if(SMTK_ENABLE_PYTHON_WRAPPING) endif() add_library(smtkCore ${smtk_srcs}) +target_compile_features(smtkCore + PUBLIC + cxx_std_17) # dependencies on generated files from subdirectories add_dependencies(smtkCore attributeGenHeaders -- GitLab From 14947845ef9d6329c1ab197a7eab8cd3ae603095 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 7 Mar 2025 16:25:25 +0100 Subject: [PATCH 04/13] cmake: require at least C++17 via `CMAKE_CXX_STANDARD` --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 690be8b37f..ae0988f4b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,10 @@ cmake_minimum_required(VERSION 3.20) #If the user/superbuild hasn't explicitly stated what c++ standard to use #require C++17 -if(NOT DEFINED CMAKE_CXX_STANDARD) +set(old_cxx_standards + 98 93 11 14) +if(NOT DEFINED CMAKE_CXX_STANDARD OR + CMAKE_CXX_STANDARD IN_LIST old_cxx_standards) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_EXTENSIONS FALSE) -- GitLab From f428a78785c4a58b23f0a26a676db4df1d6ee3cf Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 13:32:35 +0100 Subject: [PATCH 05/13] qtFileItem: use `AdjustToMinimumContentsLengthWithIcon` This is the same as `AdjustToMinimumContentsLength` but also incorporates the size of the icon (if any) as well. --- smtk/extension/qt/qtFileItem.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/smtk/extension/qt/qtFileItem.cxx b/smtk/extension/qt/qtFileItem.cxx index eb8172f497..dbceb43539 100644 --- a/smtk/extension/qt/qtFileItem.cxx +++ b/smtk/extension/qt/qtFileItem.cxx @@ -267,7 +267,7 @@ QWidget* qtFileItem::createFileBrowseWidget( } } fileExtCombo->setMinimumContentsLength(8); - fileExtCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); + fileExtCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); } } } @@ -300,10 +300,7 @@ QWidget* qtFileItem::createFileBrowseWidget( fileCombo->lineEdit()->setAlignment(Qt::AlignRight); fileCombo->setMinimumContentsLength(10); - // http://doc.qt.io/qt-5/qcombobox.html#sizeAdjustPolicy-prop - // Recommends using QComboBox::AdjustToContents, but that does not seem to - // work on Linux. - fileCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength); + fileCombo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon); } else { -- GitLab From b064ea9eb468d786993f147c9ace817b80e9f87a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 01:12:47 +0100 Subject: [PATCH 06/13] c++17: remove code supporting older C++ standards --- smtk/common/RuntimeTypeContainer.h | 25 ++++----------------- smtk/common/TypeContainer.h | 35 ++++++------------------------ 2 files changed, 11 insertions(+), 49 deletions(-) diff --git a/smtk/common/RuntimeTypeContainer.h b/smtk/common/RuntimeTypeContainer.h index 1ba1f0486a..f6f467198b 100644 --- a/smtk/common/RuntimeTypeContainer.h +++ b/smtk/common/RuntimeTypeContainer.h @@ -13,6 +13,8 @@ #include "smtk/common/TypeContainer.h" +#include + namespace smtk { namespace common @@ -153,13 +155,7 @@ public: m_container .emplace( declaredType.id(), -#ifdef SMTK_HAVE_CXX_14 - std::make_unique>(std::make_unique(value)) -#else - std::unique_ptr( - new WrapperFor(std::unique_ptr(new ActualType((value))))) -#endif - ) + std::make_unique>(std::make_unique(value))) .second; if (didInsert) { @@ -187,15 +183,8 @@ public: bool didInsert = m_container .emplace( declaredType.id(), -#ifdef SMTK_HAVE_CXX_14 std::make_unique>( std::make_unique(std::forward(args)...)) -#else - std::unique_ptr( - new WrapperFor(std::unique_ptr( - new RuntimeType(std::forward(args)...)))) -#endif - ) .second; if (didInsert) { @@ -231,13 +220,7 @@ public: search = m_container .emplace( declaredType.id(), -#ifdef SMTK_HAVE_CXX_14 - std::make_unique>(std::make_unique()) -#else - std::unique_ptr( - new WrapperFor(std::unique_ptr(new RuntimeType))) -#endif - ) + std::make_unique>(std::make_unique())) .first; } // TODO: Check that \a RuntimeType was the type used to insert \a declaredType. diff --git a/smtk/common/TypeContainer.h b/smtk/common/TypeContainer.h index 15ff8bc835..cf86779924 100644 --- a/smtk/common/TypeContainer.h +++ b/smtk/common/TypeContainer.h @@ -61,11 +61,7 @@ protected: std::unique_ptr clone() const override { -#ifdef SMTK_HAVE_CXX_14 return std::make_unique>(std::make_unique(*value)); -#else - return std::unique_ptr(new WrapperFor(new Type(*value))); -#endif } smtk::string::Token objectType() const override { return m_objectType; } @@ -139,13 +135,7 @@ public: { return m_container .emplace(std::make_pair( - this->keyId(), -#ifdef SMTK_HAVE_CXX_14 - std::make_unique>(std::make_unique(value)) -#else - std::unique_ptr(new WrapperFor(std::unique_ptr(new Type((value))))) -#endif - )) + this->keyId(), std::make_unique>(std::make_unique(value)))) .second; } @@ -175,13 +165,7 @@ public: return m_container .emplace(std::make_pair( this->keyId(), -#ifdef SMTK_HAVE_CXX_14 - std::make_unique>(std::make_unique(std::forward(args)...)) -#else - std::unique_ptr( - new WrapperFor(std::unique_ptr(new Type(std::forward(args)...)))) -#endif - )) + std::make_unique>(std::make_unique(std::forward(args)...)))) .second; } @@ -206,16 +190,11 @@ public: auto search = m_container.find(this->keyId()); if (search == m_container.end()) { - search = m_container - .emplace(std::make_pair( - this->keyId(), -#ifdef SMTK_HAVE_CXX_14 - std::make_unique>(std::make_unique()) -#else - std::unique_ptr(new WrapperFor(std::unique_ptr(new Type))) -#endif - )) - .first; + search = + m_container + .emplace(std::make_pair( + this->keyId(), std::make_unique>(std::make_unique()))) + .first; } return *(static_cast*>(search->second.get()))->value; -- GitLab From 8e1bb6af4da905d747a2572c5937b20442429f79 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 01:34:01 +0100 Subject: [PATCH 07/13] clang-tidy: fix `modernize-make-unique` lints --- applications/TemplateEditor/PreviewPanel.cxx | 2 +- smtk/attribute/ReferenceItem.cxx | 6 ++++-- smtk/common/RuntimeTypeContainer.h | 2 +- smtk/common/json/Helper.cxx | 4 +++- smtk/mesh/moab/ClosestPoint.cxx | 6 ++++-- smtk/mesh/moab/DistanceTo.cxx | 6 ++++-- smtk/mesh/moab/RandomPoint.cxx | 5 +++-- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/applications/TemplateEditor/PreviewPanel.cxx b/applications/TemplateEditor/PreviewPanel.cxx index 7c0169527e..2828f60a7f 100644 --- a/applications/TemplateEditor/PreviewPanel.cxx +++ b/applications/TemplateEditor/PreviewPanel.cxx @@ -147,7 +147,7 @@ void PreviewPanel::createViewWidget(const smtk::view::ConfigurationPtr& view) // Destroying qtUIManager will cleanup after the older PreviewWidget as it is // parented by one of its internal widgets (m_ScrollArea). - this->UIManager.reset(new smtk::extension::qtUIManager(this->AttributeResource)); + this->UIManager = std::make_unique(this->AttributeResource); this->PreviewWidget = new QWidget(this); this->PreviewWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); diff --git a/smtk/attribute/ReferenceItem.cxx b/smtk/attribute/ReferenceItem.cxx index 9273c69883..3d8cdce932 100644 --- a/smtk/attribute/ReferenceItem.cxx +++ b/smtk/attribute/ReferenceItem.cxx @@ -21,6 +21,7 @@ #include #include +#include #include namespace smtk @@ -89,7 +90,8 @@ ReferenceItem::const_iterator::~const_iterator() = default; ReferenceItem::const_iterator& ReferenceItem::const_iterator::operator=( const ReferenceItem::const_iterator& it) { - m_cacheIterator.reset(new ReferenceItem::const_iterator::CacheIterator(*(it.m_cacheIterator))); + m_cacheIterator = + std::make_unique(*(it.m_cacheIterator)); return *this; } @@ -239,7 +241,7 @@ ReferenceItem& ReferenceItem::operator=(const ReferenceItem& referenceItem) { Item::operator=(referenceItem); m_referencedAttribute = referenceItem.m_referencedAttribute; - m_cache.reset(new ReferenceItem::Cache(*(referenceItem.m_cache))); + m_cache = std::make_unique(*(referenceItem.m_cache)); m_nextUnsetPos = referenceItem.m_nextUnsetPos; return *this; } diff --git a/smtk/common/RuntimeTypeContainer.h b/smtk/common/RuntimeTypeContainer.h index f6f467198b..4d57f1aa6a 100644 --- a/smtk/common/RuntimeTypeContainer.h +++ b/smtk/common/RuntimeTypeContainer.h @@ -184,7 +184,7 @@ public: .emplace( declaredType.id(), std::make_unique>( - std::make_unique(std::forward(args)...)) + std::make_unique(std::forward(args)...))) .second; if (didInsert) { diff --git a/smtk/common/json/Helper.cxx b/smtk/common/json/Helper.cxx index bbb01253aa..5522169a9d 100644 --- a/smtk/common/json/Helper.cxx +++ b/smtk/common/json/Helper.cxx @@ -9,6 +9,8 @@ //========================================================================= #include "smtk/common/json/Helper.h" +#include + namespace smtk { namespace common @@ -35,7 +37,7 @@ Helper* Helper::activate() { throw std::logic_error("Nested link helpers are disallowed. Perhaps you forgot to deactivate?"); } - s_instance = std::unique_ptr(new IDHelper); + s_instance = std::make_unique(); return s_instance.get(); } diff --git a/smtk/mesh/moab/ClosestPoint.cxx b/smtk/mesh/moab/ClosestPoint.cxx index c85d99bc49..f7a2fedb67 100644 --- a/smtk/mesh/moab/ClosestPoint.cxx +++ b/smtk/mesh/moab/ClosestPoint.cxx @@ -17,6 +17,8 @@ #include "smtk/mesh/moab/Interface.h" #include "smtk/mesh/moab/PointLocatorCache.h" +#include + namespace smtk { namespace mesh @@ -72,8 +74,8 @@ std::array ClosestPoint::operator()( pointLocatorCache.m_caches .emplace( meshset.id(), - std::unique_ptr(new PointLocatorCache::CacheForIndex( - interface->moabInterface(), smtkToMOABRange(meshset.cells().range()), &treeOptions))) + std::make_unique( + interface->moabInterface(), smtkToMOABRange(meshset.cells().range()), &treeOptions)) .first; } diff --git a/smtk/mesh/moab/DistanceTo.cxx b/smtk/mesh/moab/DistanceTo.cxx index 8545c3896e..c202b42043 100644 --- a/smtk/mesh/moab/DistanceTo.cxx +++ b/smtk/mesh/moab/DistanceTo.cxx @@ -17,6 +17,8 @@ #include "smtk/mesh/moab/Interface.h" #include "smtk/mesh/moab/PointLocatorCache.h" +#include + namespace smtk { namespace mesh @@ -72,8 +74,8 @@ std::pair> DistanceTo::operator()( pointLocatorCache.m_caches .emplace( meshset.id(), - std::unique_ptr(new PointLocatorCache::CacheForIndex( - interface->moabInterface(), smtkToMOABRange(meshset.cells().range()), &treeOptions))) + std::make_unique( + interface->moabInterface(), smtkToMOABRange(meshset.cells().range()), &treeOptions)) .first; } diff --git a/smtk/mesh/moab/RandomPoint.cxx b/smtk/mesh/moab/RandomPoint.cxx index 28c29dbee3..90d44bbaa4 100644 --- a/smtk/mesh/moab/RandomPoint.cxx +++ b/smtk/mesh/moab/RandomPoint.cxx @@ -24,6 +24,7 @@ SMTK_THIRDPARTY_PRE_INCLUDE SMTK_THIRDPARTY_POST_INCLUDE #include +#include #include #ifndef M_PI @@ -110,8 +111,8 @@ std::array RandomPoint::operator()(const smtk::mesh::MeshSet& meshset pointLocatorCache.m_caches .emplace( meshset.id(), - std::unique_ptr(new PointLocatorCache::CacheForIndex( - interface->moabInterface(), smtkToMOABRange(meshset.cells().range()), &treeOptions))) + std::make_unique( + interface->moabInterface(), smtkToMOABRange(meshset.cells().range()), &treeOptions)) .first; } -- GitLab From 7fde9e7468cbd0234411a560bd12f5717310dfd4 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 01:14:59 +0100 Subject: [PATCH 08/13] clang-tidy: fix `bugprone-unhandled-exception-at-new` lints --- .clang-tidy | 1 - smtk/resource/query/Container.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 574cacad97..2525cfc005 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -26,7 +26,6 @@ bugprone-*,\ -bugprone-suspicious-include,\ -bugprone-string-integer-assignment,\ -bugprone-switch-missing-default-case,\ --bugprone-unhandled-exception-at-new,\ -bugprone-unhandled-self-assignment,\ -bugprone-unused-local-non-trivial-variable,\ -cert-*,\ diff --git a/smtk/resource/query/Container.h b/smtk/resource/query/Container.h index a24d26c1aa..52e3adc8b8 100644 --- a/smtk/resource/query/Container.h +++ b/smtk/resource/query/Container.h @@ -15,6 +15,7 @@ #include "smtk/resource/query/BadTypeError.h" +#include #include #include @@ -61,7 +62,7 @@ public: if (search == m_container.end()) { search = - m_container.emplace(std::make_pair(typeid(Type).hash_code(), std::unique_ptr(new Type))) + m_container.emplace(std::make_pair(typeid(Type).hash_code(), std::make_unique())) .first; } -- GitLab From 6c092085d37d2f8531825cfaaaace984f2d2232f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 28 Feb 2025 01:36:51 +0100 Subject: [PATCH 09/13] clang-tidy: fix `readability-redundant-declaration` lints --- .clang-tidy | 1 - smtk/attribute/Resource.cxx | 3 --- smtk/mesh/core/Resource.cxx | 2 -- smtk/model/Resource.cxx | 3 --- smtk/resource/Resource.cxx | 1 - smtk/string/Manager.cxx | 2 -- 6 files changed, 12 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 2525cfc005..6acf71df33 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -106,7 +106,6 @@ readability-*,\ -readability-qualified-auto,\ -readability-redundant-access-specifiers,\ -readability-redundant-control-flow,\ --readability-redundant-declaration,\ -readability-simplify-boolean-expr,\ -readability-suspicious-call-argument,\ -readability-uppercase-literal-suffix,\ diff --git a/smtk/attribute/Resource.cxx b/smtk/attribute/Resource.cxx index f217995338..afab3d5e37 100644 --- a/smtk/attribute/Resource.cxx +++ b/smtk/attribute/Resource.cxx @@ -45,9 +45,6 @@ using namespace smtk::attribute; -constexpr smtk::resource::Links::RoleType Resource::AssociationRole; -constexpr smtk::resource::Links::RoleType Resource::ReferenceRole; - namespace { using QueryList = std::tuple; diff --git a/smtk/mesh/core/Resource.cxx b/smtk/mesh/core/Resource.cxx index e82314f765..3ab3fbefd6 100644 --- a/smtk/mesh/core/Resource.cxx +++ b/smtk/mesh/core/Resource.cxx @@ -24,8 +24,6 @@ namespace smtk namespace mesh { -constexpr smtk::resource::Links::RoleType Resource::ClassificationRole; - class Resource::InternalImpl { public: diff --git a/smtk/model/Resource.cxx b/smtk/model/Resource.cxx index a7b07861ef..85cb8fdbce 100644 --- a/smtk/model/Resource.cxx +++ b/smtk/model/Resource.cxx @@ -66,9 +66,6 @@ namespace smtk namespace model { -constexpr smtk::resource::Links::RoleType Resource::AssociationRole; -constexpr smtk::resource::Links::RoleType Resource::TessellationRole; - namespace { using QueryList = std::tuple; diff --git a/smtk/resource/Resource.cxx b/smtk/resource/Resource.cxx index a6f9935a4b..de90b2788a 100644 --- a/smtk/resource/Resource.cxx +++ b/smtk/resource/Resource.cxx @@ -33,7 +33,6 @@ namespace smtk namespace resource { -constexpr smtk::resource::Links::RoleType Resource::VisuallyLinkedRole; constexpr const char* const Resource::type_name; const Resource::Index Resource::type_index = std::type_index(typeid(Resource)).hash_code(); diff --git a/smtk/string/Manager.cxx b/smtk/string/Manager.cxx index 81b77ac7b5..58dccc1079 100644 --- a/smtk/string/Manager.cxx +++ b/smtk/string/Manager.cxx @@ -19,8 +19,6 @@ namespace smtk namespace string { -constexpr Hash Manager::Invalid; - std::shared_ptr Manager::create() { auto manager = std::make_shared(); -- GitLab From 47dc14f95ffaeeb9195b30ac6dfa94aaac4361af Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 8 Mar 2025 15:37:34 +0100 Subject: [PATCH 10/13] DoubleItemDefinition: remove meaningless `const` return type --- smtk/attribute/DoubleItemDefinition.cxx | 2 +- smtk/attribute/DoubleItemDefinition.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smtk/attribute/DoubleItemDefinition.cxx b/smtk/attribute/DoubleItemDefinition.cxx index c697e90663..f6b746a7fe 100644 --- a/smtk/attribute/DoubleItemDefinition.cxx +++ b/smtk/attribute/DoubleItemDefinition.cxx @@ -59,7 +59,7 @@ bool DoubleItemDefinition::setDefaultValue(const std::vector& vals) return this->setDefaultValue(vals, m_units); } -const std::string DoubleItemDefinition::defaultValueAsString(std::size_t element) const +std::string DoubleItemDefinition::defaultValueAsString(std::size_t element) const { bool vectorDefault = m_defaultValuesAsStrings.size() == this->numberOfRequiredValues(); assert(!vectorDefault || m_defaultValuesAsStrings.size() > element); diff --git a/smtk/attribute/DoubleItemDefinition.h b/smtk/attribute/DoubleItemDefinition.h index ee95a605a5..95fa979c51 100644 --- a/smtk/attribute/DoubleItemDefinition.h +++ b/smtk/attribute/DoubleItemDefinition.h @@ -48,7 +48,7 @@ public: bool setDefaultValueAsString(const std::vector& vals); ///}@ - const std::string defaultValueAsString(std::size_t element = 0) const; + std::string defaultValueAsString(std::size_t element = 0) const; const std::vector defaultValuesAsStrings() const; smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override; -- GitLab From 368bce862108203b4471420b38be384624640e0d Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 8 Mar 2025 15:38:12 +0100 Subject: [PATCH 11/13] DoubleItemDefinition: return a const ref to the vector member --- smtk/attribute/DoubleItemDefinition.cxx | 2 +- smtk/attribute/DoubleItemDefinition.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smtk/attribute/DoubleItemDefinition.cxx b/smtk/attribute/DoubleItemDefinition.cxx index f6b746a7fe..6dbb2bacc6 100644 --- a/smtk/attribute/DoubleItemDefinition.cxx +++ b/smtk/attribute/DoubleItemDefinition.cxx @@ -67,7 +67,7 @@ std::string DoubleItemDefinition::defaultValueAsString(std::size_t element) cons : m_defaultValuesAsStrings[vectorDefault ? element : 0]; } -const std::vector DoubleItemDefinition::defaultValuesAsStrings() const +const std::vector& DoubleItemDefinition::defaultValuesAsStrings() const { return m_defaultValuesAsStrings; } diff --git a/smtk/attribute/DoubleItemDefinition.h b/smtk/attribute/DoubleItemDefinition.h index 95fa979c51..eb35a30e4b 100644 --- a/smtk/attribute/DoubleItemDefinition.h +++ b/smtk/attribute/DoubleItemDefinition.h @@ -49,7 +49,7 @@ public: ///}@ std::string defaultValueAsString(std::size_t element = 0) const; - const std::vector defaultValuesAsStrings() const; + const std::vector& defaultValuesAsStrings() const; smtk::attribute::ItemPtr buildItem(Attribute* owningAttribute, int itemPosition) const override; smtk::attribute::ItemPtr buildItem(Item* owningItem, int position, int subGroupPosition) -- GitLab From 2d977ea6dc5baae50790b74a85fa79b901bf66d7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 8 Mar 2025 17:39:28 +0100 Subject: [PATCH 12/13] clang-tidy: suppress `modernize-use-transparent-functors` lints --- .clang-tidy | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-tidy b/.clang-tidy index 6acf71df33..8799d51ef8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -72,6 +72,7 @@ modernize-*,\ -modernize-type-traits,\ -modernize-use-auto,\ -modernize-use-trailing-return-type,\ +-modernize-use-transparent-functors,\ -modernize-use-using,\ mpi-*,\ openmp-*,\ -- GitLab From a8c13323ada8596fcbbce141d7d99d8312b046ac Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 25 Mar 2025 22:56:30 +0100 Subject: [PATCH 13/13] clang-tidy: suppress `modernize-use-nodiscard` lints --- .clang-tidy | 1 + 1 file changed, 1 insertion(+) diff --git a/.clang-tidy b/.clang-tidy index 8799d51ef8..f2284e6bfb 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -71,6 +71,7 @@ modernize-*,\ -modernize-return-braced-init-list,\ -modernize-type-traits,\ -modernize-use-auto,\ +-modernize-use-nodiscard,\ -modernize-use-trailing-return-type,\ -modernize-use-transparent-functors,\ -modernize-use-using,\ -- GitLab