Revert "example with augmented utils::bounds"

This reverts commit 25d4b3484d.
This commit is contained in:
Jacob Gissinger
2024-05-12 02:00:48 -04:00
parent 25d4b3484d
commit 61b9469fd1
5 changed files with 58 additions and 34 deletions

View File

@ -596,24 +596,15 @@ tagint utils::tnumeric(const char *file, int line, const char *str, bool do_abor
/* ----------------------------------------------------------------------
compute bounds implied by numeric str with a possible wildcard asterisk
if str is a single number or type label, return nlo = nhi = label2type(str)
------------------------------------------------------------------------- */
// clang-format off
template <typename TYPE>
void utils::bounds(const char *file, int line, const std::string &str, bigint nmin,
bigint nmax, TYPE &nlo, TYPE &nhi, Error *error, int mode = Atom::NONTYPE)
void utils::bounds(const char *file, int line, const std::string &str,
bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error)
{
nlo = nhi = -1;
if (mode != Atom::NONTYPE) {
char *typestr;
if ( typestr = utils::expand_type(FLERR, str, mode, lmp) )
nlo = nhi = utils::inumeric(FLERR, typestr, false, lmp);
delete[] typestr;
if (nlo > -1) return;
}
// check for illegal characters
// check for illegal charcters
size_t found = str.find_first_not_of("*-0123456789");
if (found != std::string::npos) {
if (error) error->all(file, line, "Invalid range string: {}", str);
@ -651,11 +642,11 @@ void utils::bounds(const char *file, int line, const std::string &str, bigint nm
}
template void utils::bounds<>(const char *, int, const std::string &,
bigint, bigint, int &, int &, Error *, int);
bigint, bigint, int &, int &, Error *);
template void utils::bounds<>(const char *, int, const std::string &,
bigint, bigint, long &, long &, Error *, int);
bigint, bigint, long &, long &, Error *);
template void utils::bounds<>(const char *, int, const std::string &,
bigint, bigint, long long &, long long &, Error *, int);
bigint, bigint, long long &, long long &, Error *);
// clang-format on
/* -------------------------------------------------------------------------