Skip to content

Commit 1fee9a0

Browse files
committed
Correction de la définition des fonctions de std::formatter
Modification de la méthode parse dans std::formatter<LOG_TYPE, CharT> pour qu'elle soit constexpr, permettant une évaluation à la compilation. Ajout du mot-clé const à la méthode format dans std::formatter<LOG_TYPE, CharT>, garantissant qu'elle ne modifie pas l'état de l'objet.
1 parent 805e3a4 commit 1fee9a0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Engine/Logger.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <iostream>
99
#include <memory>
1010
#include <string>
11+
#include <mutex>
1112

1213
#include "log_type.h"
1314

Engine/log_type.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ template<class CharT>
1515
struct std::formatter<LOG_TYPE, CharT>
1616
{
1717
template<typename FormatParseContext>
18-
auto parse(FormatParseContext& ctx)
18+
constexpr auto parse(FormatParseContext& ctx)
1919
{
2020
/*value_format = "{:";
2121
for (auto it = begin(ctx); it != end(ctx); ++it)
@@ -32,7 +32,7 @@ struct std::formatter<LOG_TYPE, CharT>
3232
}
3333

3434
template <typename FormatContext>
35-
auto format(LOG_TYPE v, FormatContext& ctx)
35+
auto format(LOG_TYPE v, FormatContext& ctx) const
3636
{
3737
switch (v)
3838
{

0 commit comments

Comments
 (0)