template <typename FmtType, typename... Types>
UE_NODISCARD static typename TEnableIf<TIsArrayOrRefOfType<FmtType, TCHAR>::Value, FString>::Type Printf(const FmtType& Fmt, Types... Args)
{
static_assert(TIsArrayOrRefOfType<FmtType, TCHAR>::Value, "Formatting string must be a TCHAR array.");
static_assert(TAnd<TIsValidVariadicFunctionArg<Types>...>::Value, "Invalid argument(s) passed to FString::Printf");
return PrintfImpl(Fmt, Args...);
}
์ด๊ฑด๋ฐย TEnableIf ํ ํ๋ฆฟ ํด๋์ค ์จ๊ฐ์ง๊ณ ย TIsArrayOrRefOfType์์ ๊ฐ๋ณ์ธ์์ ์ ํฉํ์ง ์๋์ง
์ฒดํฌ๋ฅผ ํด์ฃผ๋๊ฑด๋ฐ ในใ ๊ฐ์ง๋ฆผ
template <typename Result>
class TEnableIf<true, Result>
{
public:
using type = Result;
using Type = Result;
};
template <typename Result>
class TEnableIf<false, Result>
{ };
๋ slate ์ฝ๋๊ฐ ๊ฐ์ฅ ์ถฉ๊ฒฉ์ด์์. ๋ด๊ฐ ์์ ์ ui ์ฝ๋ ์์ ์ ํ ๋ ๋ถํธํ๋ค๊ณ ์๊ฐํ์ง๋ง ํด๊ฒฐํ์ง ๋ชปํ๋ ๋ฌธ์ ๊ฐ ์์๋๋ฐ ๊ทธ๊ฑธ ์์๋ ๋ชปํ ๋ฐฉ๋ฒ์ผ๋ก ์ฒ๋ฆฌํ๊ณ ์์์. ๊ทผ๋ฐ ์์ ๊ฑด ๊ทธ๋ฅ tchar*๋ก ์ ์ธํ๋ฉด ์๋๋? ํ ํ๋ฆฟ ๋ฉํ ํ๋ก๊ทธ๋๋ฐ์ ๋ํต ์ดํด๋ฅผ ๋ชป ํ๊ฒ ์.
์ธ๋ฆฌ์ผ ํ ํ๋ฆฟ ์ฝ๋ ๋ณ๋ก๋๋ฐ C++11~14 ๊ณผ๋๊ธฐ ์์ ์ฝ๋๋ผ์ ๊ตฌ๋ฆผ - dc App