diff --git a/redGrapes/resource/fieldresource.hpp b/redGrapes/resource/fieldresource.hpp index 692c7ef1..bf0c4d8d 100644 --- a/redGrapes/resource/fieldresource.hpp +++ b/redGrapes/resource/fieldresource.hpp @@ -294,7 +294,7 @@ namespace redGrapes template requires( - !(traits::is_specialization_of>, FieldResource>::value + !(traits::is_specialization_of_v>, FieldResource> || std::is_same_v>, Container*>) ) FieldResource(Args&&... args) diff --git a/redGrapes/resource/ioresource.hpp b/redGrapes/resource/ioresource.hpp index 4b883b18..2d25e1c5 100644 --- a/redGrapes/resource/ioresource.hpp +++ b/redGrapes/resource/ioresource.hpp @@ -55,24 +55,24 @@ namespace redGrapes protected: ReadGuard(ResourceId id, std::shared_ptr const& obj) - : SharedResourceObject(id, obj) + : SharedResourceObject(id, obj) { } template ReadGuard(ResourceId id, Args&&... args) - : SharedResourceObject(id, std::forward(args)...) + : SharedResourceObject(id, std::forward(args)...) { } - ReadGuard(Resource< access::IOAccess> const& res, std::shared_ptr const& obj) - : SharedResourceObject(res, obj) + ReadGuard(Resource const& res, std::shared_ptr const& obj) + : SharedResourceObject(res, obj) { } template - ReadGuard(Resource< access::IOAccess> const& res, Args&&... args) - : SharedResourceObject(res, std::forward(args)...) + ReadGuard(Resource const& res, Args&&... args) + : SharedResourceObject(res, std::forward(args)...) { } }; @@ -115,13 +115,12 @@ namespace redGrapes { } - WriteGuard(Resource< access::IOAccess> const& res, std::shared_ptr const& obj) - : ReadGuard(res, obj) + WriteGuard(Resource const& res, std::shared_ptr const& obj) : ReadGuard(res, obj) { } template - WriteGuard(Resource< access::IOAccess> const& res, Args&&... args) + WriteGuard(Resource const& res, Args&&... args) : ReadGuard(res, std::forward(args)...) { } @@ -132,14 +131,13 @@ namespace redGrapes template struct IOResource : public ioresource::WriteGuard { - IOResource(std::shared_ptr const& o) - : ioresource::WriteGuard(TaskFreeCtx::create_resource_uid(), o) + IOResource(std::shared_ptr const& o) : ioresource::WriteGuard(TaskFreeCtx::create_resource_uid(), o) { } template requires( - !(traits::is_specialization_of>, IOResource>::value + !(traits::is_specialization_of_v>, IOResource> || std::is_same_v>, std::shared_ptr>) ) IOResource(Args&&... args) : ioresource::WriteGuard(TaskFreeCtx::create_resource_uid(), std::forward(args)...) @@ -147,8 +145,7 @@ namespace redGrapes } template - IOResource(IOResource const& res, std::shared_ptr const& obj) - : ioresource::WriteGuard(res, obj) + IOResource(IOResource const& res, std::shared_ptr const& obj) : ioresource::WriteGuard(res, obj) { } diff --git a/redGrapes/util/traits.hpp b/redGrapes/util/traits.hpp index 59533e58..0c16d1a6 100644 --- a/redGrapes/util/traits.hpp +++ b/redGrapes/util/traits.hpp @@ -15,6 +15,10 @@ namespace redGrapes::traits { }; + // Variable template for is_specialization_of + template class Template> + inline constexpr bool is_specialization_of_v = is_specialization_of::value; + template struct first_type {