When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
18 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
Idk where to even look on cpp reference for this, any explanation is aprecaited
Here's a proper MRE
enum class Level
{
Trace,
Debug,
Log,
Warn,
Fatal
};
void logFormatted(Level, const std::source_location&, std::string);
template<Level L, class... T>
struct betterLogger
{
betterLogger(
fmt::format_string<T...> fmt,
T&&... args,
const std::source_location location =
std::source_location::current()
)
{
logFormatted(
L, location, fmt::vformat(fmt, fmt::make_format_args(args...))
);
}
};
template<Level L, class... T>
betterLogger(fmt::format_string<T...>, T&&...) -> betterLogger<L, T...>;
error: deduction guide template contains a template parameter that cannot be deduced
betterLogger(fmt::format_string<T...>, T&&...) -> betterLogger<L, T...>;
^
note: non-deducible template parameter 'L'
template<Level L, class... T>
^
@void raven
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
hopefully its obvious what I'm trying to do here, however I'm stuck
@snow zodiac
I tried to do the think you mentioned and I'm not sure how to get the parameter packs working
I will be online after ~3 hours
thanks,
also I figured it out
this is partial template specification and C++ doesnt have it
so my origonaly sketchy ~30 line macro was the best way to do it 😄
@void raven Has your question been resolved? If so, run !solved :)
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity