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

mark all constructors explicit #180

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions include/nanoflann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class KNNResultSet
CountType count;

public:
inline KNNResultSet(CountType capacity_)
explicit inline KNNResultSet(CountType capacity_)
: indices(0), dists(0), capacity(capacity_), count(0)
{
}
Expand Down Expand Up @@ -256,7 +256,7 @@ class RadiusResultSet

std::vector<std::pair<IndexType, DistanceType>>& m_indices_dists;

inline RadiusResultSet(
explicit inline RadiusResultSet(
DistanceType radius_,
std::vector<std::pair<IndexType, DistanceType>>& indices_dists)
: radius(radius_), m_indices_dists(indices_dists)
Expand Down Expand Up @@ -1293,7 +1293,7 @@ class KDTreeSingleIndexAdaptor
{
public:
/** Deleted copy constructor*/
KDTreeSingleIndexAdaptor(const KDTreeSingleIndexAdaptor<
explicit KDTreeSingleIndexAdaptor(const KDTreeSingleIndexAdaptor<
Distance, DatasetAdaptor, DIM, AccessorType>&) =
delete;

Expand Down Expand Up @@ -1351,7 +1351,7 @@ class KDTreeSingleIndexAdaptor
*
*/
template <class... Args>
KDTreeSingleIndexAdaptor(
explicit KDTreeSingleIndexAdaptor(
const Dimension dimensionality, const DatasetAdaptor& inputData,
const KDTreeSingleIndexAdaptorParams& params, Args&&... args)
: dataset(inputData),
Expand All @@ -1361,7 +1361,7 @@ class KDTreeSingleIndexAdaptor
init(dimensionality, params);
}

KDTreeSingleIndexAdaptor(
explicit KDTreeSingleIndexAdaptor(
const Dimension dimensionality, const DatasetAdaptor& inputData,
const KDTreeSingleIndexAdaptorParams& params = {})
: dataset(inputData),
Expand Down Expand Up @@ -2166,7 +2166,7 @@ class KDTreeSingleIndexDynamicAdaptor
* @param inputData Dataset with the input features
* @param params Basically, the maximum leaf node size
*/
KDTreeSingleIndexDynamicAdaptor(
explicit KDTreeSingleIndexDynamicAdaptor(
const int dimensionality, const DatasetAdaptor& inputData,
const KDTreeSingleIndexAdaptorParams& params =
KDTreeSingleIndexAdaptorParams(),
Expand All @@ -2185,7 +2185,7 @@ class KDTreeSingleIndexDynamicAdaptor
}

/** Deleted copy constructor*/
KDTreeSingleIndexDynamicAdaptor(
explicit KDTreeSingleIndexDynamicAdaptor(
const KDTreeSingleIndexDynamicAdaptor<
Distance, DatasetAdaptor, DIM, AccessorType>&) = delete;

Expand Down Expand Up @@ -2311,7 +2311,7 @@ struct KDTreeEigenMatrixAdaptor
using Dimension = typename index_t::Dimension;

/// Constructor: takes a const ref to the matrix object with the data points
KDTreeEigenMatrixAdaptor(
explicit KDTreeEigenMatrixAdaptor(
const Dimension dimensionality,
const std::reference_wrapper<const MatrixType>& mat,
const int leaf_max_size = 10)
Expand Down