You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a template function that receives fmt::arg list and has to call 2 other functions each one calls the fmt::format as a result compilation error core.h(1653): error C2338: passing views as lvalues is disallowed occurs
Simplified example
TEST(FmtArg, namedpasssimple)
{
std::string message = formatmock("The answer is {value}","The answer is {value}", fmt::arg("value", 42));
ASSERT_EQ(message, "The answer is 42The answer is 42");
}`
How can I pass named arguments twice?
The text was updated successfully, but these errors were encountered:
I have a template function that receives fmt::arg list and has to call 2 other functions each one calls the fmt::format as a result compilation error core.h(1653): error C2338: passing views as lvalues is disallowed occurs
Simplified example
`template <typename... Args>
inline std::string formatmock(const std::string& format_str, const std::string& format_str2, Args&&... args) {
fmt::format(format_str, (args)...) + fmt::format(format_str2,std::forward(args)...);
}
TEST(FmtArg, namedpasssimple)
{
std::string message = formatmock("The answer is {value}","The answer is {value}", fmt::arg("value", 42));
ASSERT_EQ(message, "The answer is 42The answer is 42");
}`
How can I pass named arguments twice?
The text was updated successfully, but these errors were encountered: