[#BloombergLP-bslstl-SharedPtr_TestIsCallable-test-00] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/SharedPtr_TestIsCallable.adoc[SharedPtr_TestIsCallable]::test :relfileprefix: ../../../ :mrdocs: `test` overloads == Synopses Declared in `<bslstl_sharedptr.h>` This function is never defined. It provides a property‐checker that an entity of (template parameter) type `FACTORY` can be called like a function with a single argument, which is a pointer to an object of (template parameter) type `ARG`. The `sizeof()` expression provides an unevaluated context to check the validity of the enclosed expression, and the `, 0` ensures that the `sizeof` check remains valid, even if the expression returns `void`. Similarly, the cast to `void` ensures that there are no surprises with types that overload the comma operator. Note that the cast to `void` is elided for Clang compilers using versions of LLVM prior to 12, which fail to evaluate the trait properly. Note that `sizeof(decltype())` is required for MSVC due to a compiler bug in MSVC 17.6 and later (at least including 17.7.0 Preview 2.0). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ARG> static xref:BloombergLP/bslstl/SharedPtr_TestIsCallable.adoc[FalseType] xref:BloombergLP/bslstl/SharedPtr_TestIsCallable/test-08.adoc[test](...); ---- [.small]#xref:BloombergLP/bslstl/SharedPtr_TestIsCallable/test-08.adoc[_» more..._]# Overload selected when `FUNCTOR` is callable with `ARG`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ARG> static xref:BloombergLP/bslstl/SharedPtr_TestIsCallable.adoc[TrueType] xref:BloombergLP/bslstl/SharedPtr_TestIsCallable/test-0b.adoc[test](xref:bsl/enable_if-0b/type.adoc[bsl::enable_if<static_cast<bool>(sizeof ((static_cast<void>(Util::declval<FUNCTOR>()(Util::declval<ARG>())) , 0)))>::type]*); ---- [.small]#xref:BloombergLP/bslstl/SharedPtr_TestIsCallable/test-0b.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#