[#BloombergLP-bslstl-Function_InvokerUtil-throwBadFunctionCall]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Function_InvokerUtil.adoc[Function&lowbar;InvokerUtil]::throwBadFunctionCall
:relfileprefix: ../../../
:mrdocs:

Throw `bsl&colon;&colon;bad&lowbar;function&lowbar;call`, or abort if exceptions are disabled&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;function&lowbar;invokerutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;noreturn&rsqb;&rsqb;
static
void
throwBadFunctionCall();
----

== Description

Throw a `bsl&colon;&colon;bad&lowbar;function&lowbar;call` exception in an exception&hyphen;enabled build&semi; otherwise, invoke the currently installed assertion violation handler&period; Note that providing a function to throw an exception moves the code generated to throw the exception into just one place rather than inline in every function template instantiation that would call it&period; It also insulates the header files from the declaration of the exception class itself, so that only clients catching `bad&lowbar;function&lowbar;call` need to include its header&period;

== Return Value

[NOTE]
====
This function https://en.cppreference.com/cpp/language/attributes/noreturn[does not return^].
====

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