Skip to content

Commit

Permalink
Dump MAKE_STATIC_CONST
Browse files Browse the repository at this point in the history
Also dump MAYBE_UNUSED_NAMESPACE_SCOPE_CONSTEXPR
  • Loading branch information
tonyelewis committed May 17, 2021
1 parent a1d33e8 commit 25e64f5
Show file tree
Hide file tree
Showing 24 changed files with 43 additions and 173 deletions.
4 changes: 1 addition & 3 deletions source/ct_clustagglom/cath/clustagglom/link_dirn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "cath/common/algorithm/constexpr_is_uniq.hpp"
#include "cath/common/cpp20/make_array.hpp"
#include "cath/common/detail/maybe_unused_namespace_scope_constexpr.hpp"
#include "cath/common/type_aliases.hpp"

namespace cath {
Expand All @@ -47,8 +46,7 @@ namespace cath {
static_assert( common::constexpr_is_uniq( all_link_dirns ), "all_link_dirns shouldn't contain repeated values" );

/// \brief Store a constexpr record of the number of link_dirns
static constexpr size_t num_link_dirns = std::tuple_size_v< decltype( all_link_dirns ) >;
MAYBE_UNUSED_NAMESPACE_SCOPE_CONSTEXPR( num_link_dirns )
[[maybe_unused]] constexpr size_t num_link_dirns = std::tuple_size_v< decltype( all_link_dirns ) >;

namespace detail {

Expand Down
4 changes: 1 addition & 3 deletions source/ct_common/cath/common/algorithm/variadic_and.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#ifndef _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_ALGORITHM_VARIADIC_AND_HPP
#define _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_ALGORITHM_VARIADIC_AND_HPP

#include "cath/common/detail/make_static_const.hpp"

namespace cath {
namespace common {
namespace detail {
Expand Down Expand Up @@ -63,7 +61,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::variadic_and_fn, variadic_and )
[[maybe_unused]] constexpr detail::variadic_and_fn variadic_and{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_BOOST_ADDENDA_RANGE_ADAPTOR_ADJACENTED_HPP

#include "cath/common/boost_addenda/range/adaptor/range/adjacented_range.hpp"
#include "cath/common/detail/make_static_const.hpp"

namespace cath {
namespace common {
Expand All @@ -46,13 +45,8 @@ namespace cath {
return adjacented_range<const ForwardRng>( prm_range );
}
} // namespace detail
} // namespace common
} // namespace cath

namespace cath {
namespace common {

MAKE_STATIC_CONST( detail::adjacented_forwarder, adjacented )
[[maybe_unused]] constexpr detail::adjacented_forwarder adjacented{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,34 @@
#include "cath/common/boost_addenda/range/adaptor/detail/equal_grouped_holder.hpp"
#include "cath/common/boost_addenda/range/adaptor/detail/gen_forwarder.hpp"
#include "cath/common/boost_addenda/range/adaptor/range/equal_grouped_range.hpp"
#include "cath/common/detail/make_static_const.hpp"

namespace cath {
namespace common {

/// \brief TODOCUMENT
class equal_grouped_forwarder final {
public:
template <typename FN>
detail::equal_grouped_holder<FN> operator()(FN) const;
namespace detail {

detail::equal_grouped_holder<std::nullptr_t> operator()() const;
};
/// \brief TODOCUMENT
class equal_grouped_forwarder final {
public:
template <typename FN>
detail::equal_grouped_holder<FN> operator()(FN) const;

/// \brief TODOCUMENT
template <typename FN>
detail::equal_grouped_holder<FN> equal_grouped_forwarder::operator()(FN prm_unequal_function
) const {
/// \todo Come C++17, if Herb Sutter has gotten his way (n4029), just use braced list here
return detail::equal_grouped_holder<FN>{ prm_unequal_function };
}
detail::equal_grouped_holder<std::nullptr_t> operator()() const;
};

/// \brief TODOCUMENT
inline detail::equal_grouped_holder<std::nullptr_t> equal_grouped_forwarder::operator()() const {
/// \todo Come C++17, if Herb Sutter has gotten his way (n4029), just use braced list here
return detail::equal_grouped_holder<std::nullptr_t>{ nullptr };
}
/// \brief TODOCUMENT
template <typename FN>
detail::equal_grouped_holder<FN> equal_grouped_forwarder::operator()(FN prm_unequal_function
) const {
/// \todo Come C++17, if Herb Sutter has gotten his way (n4029), just use braced list here
return detail::equal_grouped_holder<FN>{ prm_unequal_function };
}

namespace detail {
/// \brief TODOCUMENT
inline detail::equal_grouped_holder<std::nullptr_t> equal_grouped_forwarder::operator()() const {
/// \todo Come C++17, if Herb Sutter has gotten his way (n4029), just use braced list here
return detail::equal_grouped_holder<std::nullptr_t>{ nullptr };
}

/// \brief Non-const range overload of operator| for equal_grouped range adaptor
template <typename RNG, typename FN>
Expand All @@ -78,13 +77,8 @@ namespace cath {
};
}
} // namespace detail
} // namespace common
} // namespace cath

namespace cath {
namespace common {

MAKE_STATIC_CONST( equal_grouped_forwarder, equal_grouped )
[[maybe_unused]] constexpr detail::equal_grouped_forwarder equal_grouped{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "cath/common/boost_addenda/range/adaptor/detail/gen_forwarder.hpp"
#include "cath/common/boost_addenda/range/adaptor/detail/limited_holder.hpp"
#include "cath/common/boost_addenda/range/adaptor/range/limited_range.hpp"
#include "cath/common/detail/make_static_const.hpp"

namespace cath {
namespace common {
Expand Down Expand Up @@ -54,13 +53,8 @@ namespace cath {
};
}
} // namespace detail
} // namespace common
} // namespace cath

namespace cath {
namespace common {

MAKE_STATIC_CONST( cath::common::detail::gen_forwarder<detail::limited_holder>, limited )
[[maybe_unused]] constexpr detail::gen_forwarder<detail::limited_holder> limited{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <vector>

#include "cath/common/boost_addenda/range/range_concept_type_aliases.hpp"
#include "cath/common/detail/make_static_const.hpp"

namespace cath::common {

Expand Down
50 changes: 0 additions & 50 deletions source/ct_common/cath/common/detail/make_static_const.hpp

This file was deleted.

This file was deleted.

4 changes: 1 addition & 3 deletions source/ct_common/cath/common/function/multiply_args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#ifndef _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_FUNCTION_MULTIPLY_ARGS_HPP
#define _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_FUNCTION_MULTIPLY_ARGS_HPP

#include "cath/common/detail/make_static_const.hpp"

namespace cath {
namespace common {
namespace detail {
Expand Down Expand Up @@ -63,7 +61,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::multiply_args_fn, multiply_args )
[[maybe_unused]] constexpr detail::multiply_args_fn multiply_args{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "cath/common/boost_addenda/range/range_concept_type_aliases.hpp"
#include "cath/common/cpp14/cbegin_cend.hpp"
#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/detail/tuple_index_sequence.hpp"
#include "cath/common/type_traits/is_tuple.hpp"

Expand Down Expand Up @@ -128,7 +127,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::mins_maxs_tuple_pair_mins_maxs_element_fn, mins_maxs_tuple_pair_mins_maxs_element )
[[maybe_unused]] constexpr detail::mins_maxs_tuple_pair_mins_maxs_element_fn mins_maxs_tuple_pair_mins_maxs_element{};

} // namespace common
} // namespace cath
Expand Down
3 changes: 1 addition & 2 deletions source/ct_common/cath/common/tuple/tuple_increment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#ifndef _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_TUPLE_TUPLE_INCREMENT_HPP
#define _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_TUPLE_TUPLE_INCREMENT_HPP

#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/detail/tuple_index_sequence.hpp"
#include "cath/common/type_traits/is_tuple.hpp"

Expand Down Expand Up @@ -74,7 +73,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::tuple_increment_fn, tuple_increment )
[[maybe_unused]] constexpr detail::tuple_increment_fn tuple_increment{};

} // namespace common
} // namespace cath
Expand Down
3 changes: 1 addition & 2 deletions source/ct_common/cath/common/tuple/tuple_lattice_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <cstddef>
#include <tuple>

#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/detail/tuple_index_sequence.hpp"
#include "cath/common/type_traits.hpp"
#include "cath/common/type_traits/is_tuple.hpp"
Expand Down Expand Up @@ -86,7 +85,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::tuple_lattice_index_fn, tuple_lattice_index )
[[maybe_unused]] constexpr detail::tuple_lattice_index_fn tuple_lattice_index{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include "cath/common/boost_addenda/range/range_concept_type_aliases.hpp"
#include "cath/common/cpp14/cbegin_cend.hpp"
#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/detail/tuple_index_sequence.hpp"
#include "cath/common/type_traits/is_tuple.hpp"

Expand Down Expand Up @@ -115,7 +114,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::tuple_mins_maxs_element_fn, tuple_mins_maxs_element )
[[maybe_unused]] constexpr detail::tuple_mins_maxs_element_fn tuple_mins_maxs_element{};

} // namespace common
} // namespace cath
Expand Down
3 changes: 1 addition & 2 deletions source/ct_common/cath/common/tuple/tuple_multiply_args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define _CATH_TOOLS_SOURCE_CT_COMMON_CATH_COMMON_TUPLE_TUPLE_MULTIPLY_ARGS_HPP

#include "cath/common/cpp17/apply.hpp"
#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/function/multiply_args.hpp"
#include "cath/common/type_traits/is_tuple.hpp"

Expand Down Expand Up @@ -52,7 +51,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::tuple_multiply_args_fn, tuple_multiply_args )
[[maybe_unused]] constexpr detail::tuple_multiply_args_fn tuple_multiply_args{};

} // namespace common
} // namespace cath
Expand Down
3 changes: 1 addition & 2 deletions source/ct_common/cath/common/tuple/tuple_subtract.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <cstddef>
#include <tuple>

#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/type_traits.hpp"

namespace cath {
Expand Down Expand Up @@ -67,7 +66,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::tuple_subtract_fn, tuple_subtract )
[[maybe_unused]] constexpr detail::tuple_subtract_fn tuple_subtract{};

} // namespace common
} // namespace cath
Expand Down
3 changes: 1 addition & 2 deletions source/ct_common/cath/common/tuple/tuple_within_range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <cstddef>

#include "cath/common/algorithm/variadic_and.hpp"
#include "cath/common/detail/make_static_const.hpp"
#include "cath/common/detail/tuple_index_sequence.hpp"

namespace cath {
Expand Down Expand Up @@ -67,7 +66,7 @@ namespace cath {

} // namespace detail

MAKE_STATIC_CONST( detail::tuple_within_range_fn, tuple_within_range )
[[maybe_unused]] constexpr detail::tuple_within_range_fn tuple_within_range{};

} // namespace common
} // namespace cath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <boost/any.hpp>

#include "cath/common/algorithm/constexpr_is_uniq.hpp"
#include "cath/common/detail/maybe_unused_namespace_scope_constexpr.hpp"
#include "cath/common/type_aliases.hpp"

#include <array>
Expand Down Expand Up @@ -58,8 +57,7 @@ namespace cath {
static_assert( common::constexpr_is_uniq( all_hits_input_format_tags ), "all_hits_input_format_tags shouldn't contain repeated values" );

/// \brief Store a constexpr record of the number of hits_input_format_tags
static constexpr size_t num_hits_input_format_tags = std::tuple_size_v< decltype( all_hits_input_format_tags ) >;
MAYBE_UNUSED_NAMESPACE_SCOPE_CONSTEXPR( num_hits_input_format_tags )
[[maybe_unused]] constexpr size_t num_hits_input_format_tags = std::tuple_size_v< decltype( all_hits_input_format_tags ) >;

namespace detail {

Expand Down

0 comments on commit 25e64f5

Please sign in to comment.