[#CBlockIndex-2constructor-0f]
= xref:CBlockIndex.adoc[CBlockIndex]::CBlockIndex
:relfileprefix: ../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;chain&period;h&gt;`

CBlockIndex should not allow public copy construction because equality comparison via pointer is very common throughout the codebase, making use of copy a footgun&period; Also, use of copies do not have the benefit of simplifying lifetime considerations due to attributes like pprev and pskip, which are at risk of becoming dangling pointers in a copied instance&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:CBlockIndex/2constructor-0c.adoc[CBlockIndex](xref:CBlockIndex.adoc[CBlockIndex] const& other) = default;
----

[.small]#xref:CBlockIndex/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Move construction is deleted to avoid accidental copies of block index entries&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CBlockIndex/2constructor-01.adoc[CBlockIndex](xref:CBlockIndex.adoc[CBlockIndex]&& other) = delete;
----

[.small]#xref:CBlockIndex/2constructor-01.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| The entry to copy from&period;
|===


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