[#BloombergLP-bsltf-DegenerateFunctor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::DegenerateFunctor
:relfileprefix: ../../
:mrdocs:

Awkward CopyConstructible functor adapter for testing generic code&period;

== Synopsis

Declared in `&lt;bsltf&lowbar;degeneratefunctor&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class FUNCTOR,
    bool ENABLE&lowbar;SWAP = true&gt;
class DegenerateFunctor;
----

== Description

This test class template adapts a CopyConstructible class to offer a minimal or outright obstructive interface for testing generic code&period; To support the testing of standard containers, this adapter will be MoveConstructible, CopyConstructible, and nothrow Destructible as long as the adapted `FUNCTOR` satisfies the same requirements&period; This class will further be Swappable if (the template parameter) `ENABLE&lowbar;SWAP` is `true` and the adapted `FUNCTOR` is MoveConstructible&period; The (inherited) function call operator should be the only other available method, no other operation (e&period;g&period;, the unary address&hyphen;of operator) should be usable&period; We take advantage of the fact that defining a copy constructor inhibits the generation of a default constructor, and that constructors are not inherited by a derived class&period; `DegenerateFunctor` objects must be created through either the copy constructor, or by wrapping a `FUNCTOR` object through the static factory method of this class, `cloneBaseObject`&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/DegenerateFunctor/2constructor-00.adoc[`DegenerateFunctor`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bsltf/DegenerateFunctor/exchangeValues.adoc[`exchangeValues`] 
| Swap the wrapped `FUNCTOR` values with those of the specified `other`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/DegenerateFunctor/cloneBaseObject.adoc[`cloneBaseObject`] 
| Create a `DegenerateFunctor` wrapping a copy of the specified `base`&period;
|===


== Using Declarations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/DegenerateFunctor/operator().adoc[`operator()`] 
| Expose the overloaded function call operator from the parameterizing class `FUNCTOR`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsltf/swap-02.adoc[`swap`]
| Exchange the values of the specified `lhs` and `rhs` objects&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
