是否有声明lambda之后立即调用以使用其返回值初始化局部变量的目的?

template<typename T>
    static const Metatype* get_metatype() {
        static const Metatype* mt = []() {
            constexpr size_t name_hash = Metatype::build_hash<T>().name_hash;

            auto type = metatype_cache.find(name_hash);
            if (type == metatype_cache.end()) {
                constexpr Metatype newtype = Metatype::build<T>();
                metatype_cache[name_hash] = newtype;
            }
            return &metatype_cache[name_hash];
        }();
        return mt;
    }

变量mt由lambda的返回值初始化。为什么不只提取lambda代码并将其作为get_metatype()函数的一部分,然后仅从中返回值呢?这是一些性能技巧吗?

This code from decs https://github.com/vblanco20-1/decs project that i am learning for educational purposes.