Update header source format with clang-format

Most changes are to better fit within "ColumnLimit: 80".

The change from "T &&... var" to "T &&...var" is caused by
"PointerAlignment: Right".

Member functions chained from add_argument() use ContinuationIndentWidth,
which is set to 4.  Setting ContinuationIndentWidth to 2 causes many
other continuation lines to change.  So, this commit uses the original
value (i.e. 4) as the preferred size.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This commit is contained in:
Sean Robinson 2022-02-07 14:33:16 -07:00
parent 486bfdaf8d
commit cb2777db6e

View File

@ -55,17 +55,15 @@ namespace argparse {
namespace details { // namespace for helper methods
template <typename T, typename = void>
struct is_container : std::false_type {};
template <typename T, typename = void> struct is_container : std::false_type {};
template <> struct is_container<std::string> : std::false_type {};
template <typename T>
struct is_container<T, std::void_t<typename T::value_type,
decltype(std::declval<T>().begin()),
struct is_container<
T, std::void_t<typename T::value_type, decltype(std::declval<T>().begin()),
decltype(std::declval<T>().end()),
decltype(std::declval<T>().size())>>
: std::true_type {};
decltype(std::declval<T>().size())>> : std::true_type {};
template <typename T>
static constexpr bool is_container_v = is_container<T>::value;
@ -74,8 +72,8 @@ template <typename T, typename = void>
struct is_streamable : std::false_type {};
template <typename T>
struct is_streamable<
T, std::void_t<decltype(std::declval<std::ostream&>() << std::declval<T>())>>
struct is_streamable<T, std::void_t<decltype(std::declval<std::ostream &>()
<< std::declval<T>())>>
: std::true_type {};
template <typename T>
@ -100,7 +98,8 @@ template <typename T> std::string repr(T const &val) {
out << repr(*val.begin());
std::for_each(
std::next(val.begin()),
std::next(val.begin(), std::min<std::size_t>(size, repr_max_container_size) - 1),
std::next(val.begin(),
std::min<std::size_t>(size, repr_max_container_size) - 1),
[&out](const auto &v) { out << " " << repr(v); });
if (size <= repr_max_container_size) {
out << " ";
@ -891,12 +890,12 @@ public:
mIsParsed(other.mIsParsed),
mPositionalArguments(other.mPositionalArguments),
mOptionalArguments(other.mOptionalArguments) {
for (auto it = std::begin(mPositionalArguments); it != std::end(mPositionalArguments);
++it) {
for (auto it = std::begin(mPositionalArguments);
it != std::end(mPositionalArguments); ++it) {
index_argument(it);
}
for (auto it = std::begin(mOptionalArguments); it != std::end(mOptionalArguments);
++it) {
for (auto it = std::begin(mOptionalArguments);
it != std::end(mOptionalArguments); ++it) {
index_argument(it);
}
}