Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add GTSAM_USE_BOOST_FEATURES to definitions #1995

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ArkadiuszNiemiec
Copy link

@ArkadiuszNiemiec ArkadiuszNiemiec commented Jan 23, 2025

This fixes the issue #1994 and some issues mentioned in #1967 and #1981.

The change defines the proper identifier if GTSAM_USE_BOOST_FEATURES option is set in CMakeLists.txt.
It's used in:

#if GTSAM_USE_BOOST_FEATURES
#include <boost/concept_check.hpp>
#include <boost/concept/assert.hpp>
#include <boost/concept/requires.hpp>
#include <boost/concept_check.hpp>
#define GTSAM_CONCEPT_ASSERT(concept) BOOST_CONCEPT_ASSERT((concept))
#define GTSAM_CONCEPT_REQUIRES(concept, return_type) BOOST_CONCEPT_REQUIRES(((concept)), (return_type))
#else
// This does something sensible:
#define BOOST_CONCEPT_USAGE(concept) void check##concept()
// These just ignore the concept checking for now:
#define GTSAM_CONCEPT_ASSERT(concept) static_assert(true, "")
#define GTSAM_CONCEPT_REQUIRES(concept, return_type) return_type
#endif

...and without it the compiler throws BOOST_CONCEPT_USAGE redefinition error.

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.

1 participant