EnTT: src/entt/resource/loader.hpp Source File

EnTT 3.15.0

Loading...
Searching...
No Matches
loader.hpp
1#ifndef ENTT_RESOURCE_LOADER_HPP
2#define ENTT_RESOURCE_LOADER_HPP
3
4#include <memory>
5#include <utility>
6#include "fwd.hpp"
7
8namespace entt {
9
14template<typename Type>
15 struct resource_loader {
17 using result_type = std::shared_ptr<Type>;
18
25 template<typename... Args>
26 result_type operator()(Args &&...args) const {
27 return std::make_shared<Type>(std::forward<Args>(args)...);
28 }
29};
30
31} // namespace entt
32
33#endif
entt
EnTT default namespace.
Definition dense_map.hpp:22
entt::resource_loader
Transparent loader for shared resources.
Definition loader.hpp:15
entt::resource_loader::operator()
result_type operator()(Args &&...args) const
Constructs a shared pointer to a resource from its arguments.
Definition loader.hpp:26
entt::resource_loader::result_type
std::shared_ptr< Type > result_type
Result type.
Definition loader.hpp:17