[#BloombergLP-bdlcc-ObjectPool-2constructor-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/ObjectPool.adoc[ObjectPool]::ObjectPool
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bdlcc&lowbar;objectpool&period;h&gt;`

Create an object pool that default&hyphen;constructs objects of `TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlcc/ObjectPool/2constructor-09.adoc[ObjectPool](
    int growBy = &hyphen;1,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlcc/ObjectPool/2constructor-09.adoc[_» more&period;&period;&period;_]#

Create an object pool that constructs objects using `objectCreator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlcc/ObjectPool/2constructor-07.adoc[ObjectPool](
    CREATOR const& objectCreator,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlcc/ObjectPool/2constructor-07.adoc[_» more&period;&period;&period;_]#

DEPRECATED&colon; Use a creator of the parameterized `CREATOR` type&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ANYPROTO&gt;
explicit
xref:BloombergLP/bdlcc/ObjectPool/2constructor-08a.adoc[ObjectPool](
    xref:bsl/function-0a.adoc[bsl::function&lt;ANYPROTO&gt;] const& objectCreator,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlcc/ObjectPool/2constructor-08a.adoc[_» more&period;&period;&period;_]#

Create an object pool that constructs objects using `objectCreator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlcc/ObjectPool/2constructor-0b.adoc[ObjectPool](
    CREATOR const& objectCreator,
    int growBy,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlcc/ObjectPool/2constructor-0b.adoc[_» more&period;&period;&period;_]#

DEPRECATED&colon; Use a creator of the parameterized `CREATOR` type&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ANYPROTO&gt;
explicit
xref:BloombergLP/bdlcc/ObjectPool/2constructor-086.adoc[ObjectPool](
    xref:bsl/function-0a.adoc[bsl::function&lt;ANYPROTO&gt;] const& objectCreator,
    int growBy,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlcc/ObjectPool/2constructor-086.adoc[_» more&period;&period;&period;_]#

Create an object pool with the specified creator and resetter&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlcc/ObjectPool/2constructor-02.adoc[ObjectPool](
    CREATOR const& objectCreator,
    RESETTER const& objectResetter,
    int growBy = &hyphen;1,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlcc/ObjectPool/2constructor-02.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *growBy*
| replenishment increment (or geometric start if negative)
| *basicAllocator*
| allocator used to supply memory
| *objectCreator*
| functor used to construct pooled objects
| *objectResetter*
| functor invoked when objects are released
|===


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