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

Fixes #192 via nested and remove using #196

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Checks: >
-fuchsia-*,
-llvmlibc-*,
-llvm-header-guard,
-modernize-concat-nested-namespaces,
-readability-avoid-const-params-in-decls

WarningsAsErrors: '*'
Expand Down
1 change: 0 additions & 1 deletion .tidy/make/make_tidy_03_flags.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ TIDY_CHECKS = "*,
-fuchsia-*, \
-llvmlibc-*, \
-llvm-header-guard, \
-modernize-concat-nested-namespaces, \
-readability-avoid-const-params-in-decls"

TIDY_FLAGS = --extra-arg-before=--driver-mode=g++ \
Expand Down
11 changes: 4 additions & 7 deletions boost/multiprecision/uintwide_t_backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <math/wide_integer/uintwide_t.h>

namespace boost { namespace multiprecision {
namespace boost::multiprecision {

// Forward declaration of the uintwide_t_backend multiple precision class.
// This class binds native (WIDE_INTEGER_NAMESPACE)::math::wide_integer::uintwide_t
Expand Down Expand Up @@ -707,10 +707,9 @@
*result = static_cast<long double>(val.crepresentation());
}

} // namespace multiprecision
} // namespace boost
} // namespace boost::multiprecision

namespace boost { namespace math { namespace policies {
namespace boost::math::policies {

// Specialization of the precision structure.
template<
Expand Down Expand Up @@ -741,9 +740,7 @@
#endif
};

} // namespace policies
} // namespace math
} // namespace boost
} // namespace boost::math::policies

namespace std // NOLINT(cert-dcl58-cpp)
{
Expand Down
17 changes: 15 additions & 2 deletions examples/example000_numeric_limits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@

namespace local
{
#if defined(WIDE_INTEGER_NAMESPACE)
using WIDE_INTEGER_NAMESPACE::math::wide_integer::uint64_t;
using WIDE_INTEGER_NAMESPACE::math::wide_integer::int64_t;
#else
using math::wide_integer::uint64_t;
using math::wide_integer::int64_t;
#endif

#if defined(WIDE_INTEGER_NAMESPACE)
using uint32_t = math::wide_integer::uintwide_t<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t(UINT32_C(32)), std::uint8_t, void, false>;
using int32_t = math::wide_integer::uintwide_t<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t(UINT32_C(32)), std::uint8_t, void, true>;
using uint32_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t(UINT32_C(32)), std::uint8_t, void, false>;
using int32_t = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t(UINT32_C(32)), std::uint8_t, void, true>;
#else
using uint32_t = math::wide_integer::uintwide_t<math::wide_integer::size_t(UINT32_C(32)), std::uint8_t, void, false>;
using int32_t = math::wide_integer::uintwide_t<math::wide_integer::size_t(UINT32_C(32)), std::uint8_t, void, true>;
#endif
} // namespace local

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example000_numeric_limits() -> bool
#else
auto math::wide_integer::example000_numeric_limits() -> bool
#endif
{
bool result_is_ok = true;

Expand Down Expand Up @@ -148,7 +157,11 @@ auto math::wide_integer::example000_numeric_limits() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example000_numeric_limits();
#else
const bool result_is_ok = wide_integer::example000_numeric_limits();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example000a_builtin_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ namespace local
}
} // namespace local

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example000a_builtin_convert() -> bool
#else
auto math::wide_integer::example000a_builtin_convert() -> bool
#endif
{
bool result_is_ok = true;

Expand Down Expand Up @@ -77,7 +81,11 @@ auto math::wide_integer::example000a_builtin_convert() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example000a_builtin_convert();
#else
const bool result_is_ok = wide_integer::example000a_builtin_convert();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example001_mul_div.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example001_mul_div() -> bool
#else
auto math::wide_integer::example001_mul_div() -> bool
#endif
{
using math::wide_integer::uint256_t;

Expand Down Expand Up @@ -36,7 +40,11 @@ auto math::wide_integer::example001_mul_div() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example001_mul_div();
#else
const bool result_is_ok = wide_integer::example001_mul_div();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example001a_div_mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example001a_div_mod() -> bool
#else
auto math::wide_integer::example001a_div_mod() -> bool
#endif
{
using math::wide_integer::uint512_t;

Expand Down Expand Up @@ -39,7 +43,11 @@ auto math::wide_integer::example001a_div_mod() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example001a_div_mod();
#else
const bool result_is_ok = wide_integer::example001a_div_mod();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example002_shl_shr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example002_shl_shr() -> bool
#else
auto math::wide_integer::example002_shl_shr() -> bool
#endif
{
using math::wide_integer::uint256_t;

Expand All @@ -35,7 +39,11 @@ auto math::wide_integer::example002_shl_shr() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example002_shl_shr();
#else
const bool result_is_ok = wide_integer::example002_shl_shr();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example003_sqrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example003_sqrt() -> bool
#else
auto math::wide_integer::example003_sqrt() -> bool
#endif
{
using math::wide_integer::uint256_t;

Expand All @@ -33,7 +37,11 @@ auto math::wide_integer::example003_sqrt() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example003_sqrt();
#else
const bool result_is_ok = wide_integer::example003_sqrt();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example003a_cbrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example003a_cbrt() -> bool
#else
auto math::wide_integer::example003a_cbrt() -> bool
#endif
{
#if defined(WIDE_INTEGER_NAMESPACE)
using uint11264_t = math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(11264)), std::uint32_t, std::allocator<std::uint32_t>>;
Expand Down Expand Up @@ -46,7 +50,11 @@ auto math::wide_integer::example003a_cbrt() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example003a_cbrt();
#else
const bool result_is_ok = wide_integer::example003a_cbrt();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example004_rootk_pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example004_rootk_pow() -> bool
#else
auto math::wide_integer::example004_rootk_pow() -> bool
#endif
{
bool result_is_ok = true;

Expand Down Expand Up @@ -83,7 +87,11 @@ auto math::wide_integer::example004_rootk_pow() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example004_rootk_pow();
#else
const bool result_is_ok = wide_integer::example004_rootk_pow();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example005_powm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example005_powm() -> bool
#else
auto math::wide_integer::example005_powm() -> bool
#endif
{
using math::wide_integer::uint256_t;

Expand All @@ -32,7 +36,11 @@ auto math::wide_integer::example005_powm() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example005_powm();
#else
const bool result_is_ok = wide_integer::example005_powm();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example005a_pow_factors_of_p99.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example005a_pow_factors_of_p99() -> bool
#else
auto math::wide_integer::example005a_pow_factors_of_p99() -> bool
#endif
{
#if defined(WIDE_INTEGER_NAMESPACE)
using uint384_t = math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(384))>;
Expand Down Expand Up @@ -60,7 +64,11 @@ auto math::wide_integer::example005a_pow_factors_of_p99() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example005a_pow_factors_of_p99();
#else
const bool result_is_ok = wide_integer::example005a_pow_factors_of_p99();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example006_gcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example006_gcd() -> bool
#else
auto math::wide_integer::example006_gcd() -> bool
#endif
{
using math::wide_integer::uint256_t;

Expand All @@ -34,7 +38,11 @@ auto math::wide_integer::example006_gcd() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example006_gcd();
#else
const bool result_is_ok = wide_integer::example006_gcd();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example007_random_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ namespace local_random
}
} // namespace local_random

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example007_random_generator() -> bool
#else
auto math::wide_integer::example007_random_generator() -> bool
#endif
{
const bool result_08_is_ok = local_random::generate<std::uint8_t> ();
const bool result_16_is_ok = local_random::generate<std::uint16_t>();
Expand All @@ -77,7 +81,11 @@ auto math::wide_integer::example007_random_generator() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example007_random_generator();
#else
const bool result_is_ok = wide_integer::example007_random_generator();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
8 changes: 8 additions & 0 deletions examples/example008_miller_rabin_prime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#include <examples/example_uintwide_t.h>
#include <math/wide_integer/uintwide_t.h>

#if defined(WIDE_INTEGER_NAMESPACE)
auto WIDE_INTEGER_NAMESPACE::math::wide_integer::example008_miller_rabin_prime() -> bool
#else
auto math::wide_integer::example008_miller_rabin_prime() -> bool
#endif
{
#if defined(WIDE_INTEGER_NAMESPACE)
using wide_integer_type = WIDE_INTEGER_NAMESPACE::math::wide_integer::uintwide_t<static_cast<WIDE_INTEGER_NAMESPACE::math::wide_integer::size_t>(UINT32_C(512))>;
Expand Down Expand Up @@ -88,7 +92,11 @@ auto math::wide_integer::example008_miller_rabin_prime() -> bool

int main()
{
#if defined(WIDE_INTEGER_NAMESPACE)
const bool result_is_ok = WIDE_INTEGER_NAMESPACE::wide_integer::example008_miller_rabin_prime();
#else
const bool result_is_ok = wide_integer::example008_miller_rabin_prime();
#endif

std::cout << "result_is_ok: " << std::boolalpha << result_is_ok << std::endl;
}
Expand Down
Loading