Skip to content

Commit 2fc193d

Browse files
committed
Patch release 0.8.1
Remove etl::details namespace.
1 parent 62c526c commit 2fc193d

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
7+
## [0.8.1] - 2024-12-22
8+
9+
### Changed
10+
11+
- Removed internal `etl::detail` namespace, as it was causing issues with `SourceCodeLocation`
12+
when using the RUNTIME_INFO macro.
13+
614
## [0.8.0] - 2024-12-17
715

816
### Added

etl/examples/blackjack/blackjack.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Error : public etl::BaseError
2929
{
3030
}
3131

32-
Error(const std::string_view &msg, const etl::detail::SourceCodeLocation &slc) noexcept : etl::BaseError(msg, slc)
32+
Error(const std::string_view &msg, const etl::SourceCodeLocation &slc) noexcept : etl::BaseError(msg, slc)
3333
{
3434
}
3535
};

etl/include/etl.hpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ namespace etl
4242

4343
constexpr auto VERSION_MAJOR = 0;
4444
constexpr auto VERSION_MINOR = 8;
45-
constexpr auto VERSION_PATCH = 0;
45+
constexpr auto VERSION_PATCH = 1;
4646
constexpr auto VERSION = (VERSION_MAJOR * 10000) + (VERSION_MINOR * 100) + VERSION_PATCH;
47-
constexpr std::string_view VERSION_STRING = "0.8.0";
47+
constexpr std::string_view VERSION_STRING = "0.8.1";
4848

4949
/// @brief Ditch those old C style for loops and iterate over your enums safely with ranged for loops.
5050
///
@@ -444,11 +444,6 @@ template <typename Tag, typename FundamentalType> class TaggedFundamental
444444
}
445445
};
446446

447-
/// @brief User of etl should not use anything in the detail namespace, SourceCodeLocation location type only has to be
448-
/// used in one of the constructors of an error class which implements etl::BaseError
449-
namespace detail
450-
{
451-
452447
/// @brief Holds useful runtime source code location information for use in Errors.
453448
///
454449
/// @details Should not be used directly, rather the user should pass the `etl::RUNTIME_INFO`
@@ -500,15 +495,13 @@ class SourceCodeLocation
500495
std::string m_func;
501496
};
502497

503-
} // namespace detail
504-
505498
/// @brief Wrapper macro which constructs an instance of SourceCodeLocation in-place
506499
/// and guarantees that the accurate file, function name, and line number will be
507500
/// reported.
508501
#ifdef __linux__
509-
#define RUNTIME_INFO detail::SourceCodeLocation(__FILE__, __LINE__, static_cast<const char *>(__PRETTY_FUNCTION__))
502+
#define RUNTIME_INFO SourceCodeLocation(__FILE__, __LINE__, static_cast<const char *>(__PRETTY_FUNCTION__))
510503
#else
511-
#define RUNTIME_INFO detail::SourceCodeLocation(__FILE__, __LINE__, static_cast<const char *>(__func__))
504+
#define RUNTIME_INFO SourceCodeLocation(__FILE__, __LINE__, static_cast<const char *>(__func__))
512505
#endif
513506

514507
/// @brief Base Abstract Error for use with the Result and DynError types.
@@ -531,7 +524,7 @@ class BaseError
531524
///
532525
/// @param `msg` the error message
533526
/// @param `slc` the source code location object
534-
BaseError(const std::string_view &msg, const detail::SourceCodeLocation &slc) noexcept : m_msg(msg)
527+
BaseError(const std::string_view &msg, const SourceCodeLocation &slc) noexcept : m_msg(msg)
535528
{
536529
m_info.append("Error: ")
537530
.append(msg)

etl/tests/result_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GenericError : public etl::BaseError
1414
{
1515
}
1616

17-
GenericError(const std::string_view &msg, const etl::detail::SourceCodeLocation &slc) noexcept : etl::BaseError(msg, slc)
17+
GenericError(const std::string_view &msg, const etl::SourceCodeLocation &slc) noexcept : etl::BaseError(msg, slc)
1818
{
1919
}
2020
};
@@ -26,7 +26,7 @@ class OtherError : public etl::BaseError
2626
{
2727
}
2828

29-
OtherError(const std::string_view &msg, const etl::detail::SourceCodeLocation &slc) noexcept : etl::BaseError(msg, slc)
29+
OtherError(const std::string_view &msg, const etl::SourceCodeLocation &slc) noexcept : etl::BaseError(msg, slc)
3030
{
3131
}
3232
};

etl/tests/version_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
TEST(EtlVersionTests, EnsureVersionStringIsCorrect)
55
{
6-
ASSERT_EQ(etl::VERSION_STRING, "0.8.0");
6+
ASSERT_EQ(etl::VERSION_STRING, "0.8.1");
77
}
88

99
TEST(EtlVersionTests, EnsureVersionIntIsCorrect)
1010
{
1111
ASSERT_EQ(etl::VERSION_MAJOR, 0);
1212
ASSERT_EQ(etl::VERSION_MINOR, 8);
13-
ASSERT_EQ(etl::VERSION_PATCH, 0);
13+
ASSERT_EQ(etl::VERSION_PATCH, 1);
1414
}

0 commit comments

Comments
 (0)