Skip to content

Commit

Permalink
Fix access violation on MSVC
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Artsishevsky <polter.rnd@gmail.com>
  • Loading branch information
polter-rnd committed Jun 7, 2024
1 parent 11569c1 commit 42c2933
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/log/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Format final {
*
* @return Format string.
*/
[[nodiscard]] constexpr auto fmt() const -> auto
[[nodiscard]] constexpr auto fmt() const -> const auto&
{
return m_fmt;
}
Expand All @@ -97,7 +97,7 @@ class Format final {
*
* @return Location.
*/
[[nodiscard]] constexpr auto loc() const -> auto
[[nodiscard]] constexpr auto loc() const -> const auto&
{
return m_loc;
}
Expand Down
3 changes: 1 addition & 2 deletions include/log/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ class Logger {
void
message(Level level, Format<CharType, std::type_identity_t<Args>...> fmt, Args&&... args) const
{
auto callback = [&fmt = static_cast<const decltype(fmt.fmt())>(fmt.fmt())](
auto& buffer, Args&&... args) {
auto callback = [&fmt = fmt.fmt()](auto& buffer, Args&&... args) {
buffer.format(fmt, std::forward<Args>(args)...);
};

Expand Down

0 comments on commit 42c2933

Please sign in to comment.