function Class
Sarmalayıcı nesnesinde çağrılabilir.
template<class Fty>
class function // Fty of type Ret(T1, T2, ..., TN)
: public unary_function<T1, Ret> // when Fty is Ret(T1)
: public binary_function<T1, T2, Ret> // when Fty is Ret(T1, T2)
{
public:
typedef Ret result_type;
function();
function(nullptr_t);
function(const function& _Right);
template<class Fty2>
function(Fty2 fn);
template<class Fty2, class Alloc>
function (reference_wrapper<Fty2>, const Alloc& _Ax);
template<class Fty2, class Alloc>
void assign (Fty2, const Alloc& _Ax);
template<class Fty2, class Alloc>
assign (reference_wrapper<Fty2>, const Alloc& _Ax);
function& operator=(nullptr_t);
function& operator=(const function&);
template<class Fty2>
function& operator=(Fty2);
template<class Fty2>
function& operator=(reference_wrapper<Fty2>);
void swap(function&);
explicit operator bool() const;
result_type operator()(T1, T2, ....., TN) const;
const std::type_info& target_type() const;
template<class Fty2>
Fty2 *target();
template<class Fty2>
const Fty2 *target() const;
template<class Fty2>
void operator==(const Fty2&) const = delete;
template<class Fty2>
void operator!=(const Fty2&) const = delete;
};
Parametreler
Fty
KAYDIR işlevi türü._Ax
Ayırıcı işlevi.
Notlar
Şablon sınıf, çağrı imzası olan bir çağrı sarıcı olan Ret(T1, T2, ..., TN).Tek tip bir sarıcı callable nesneleri çeşitli kapsamak için kullanın.
Bazı üye fonksiyonları istenen hedef nesne adları bir işlenen alır.Bu tür bir işlenen çeşitli yollarla belirtebilirsiniz:
fn--callable nesne fn; çağrısının function nesnesi, bir kopyasını tutarfn
fnref--tarafından adlı callable nesne fnref.get(); çağrısının function nesnesi, bir başvuru tutarfnref.get()
right--callable nesne varsa, tuttuğu function nesneright
npc--bir null işaretçi; çağrısının function nesne boş
Tüm durumlarda, INVOKE(f, t1, t2, ..., tN), nerede f callable nesnesidir ve t1, t2, ..., tN lvalues türü olan T1, T2, ..., TN sırasıyla, iyi biçimlendirilmiş olması gerekir ve Eğer Ret void, dönüştürülebilir için değil Ret.
Boş bir function nesnesi değil tutun çağrılabilir bir nesne veya callable nesnesine bir başvuru.
Oluşturucular
Boş ya da sabit bir imza ile rasgele tür çağrılabilir bir nesne saklayan bir sarmalayıcı oluşturur. |
TypeDef
Saklı callable nesnenin dönüş türü. |
Üye işlevleri
Bu işlev nesnenin callable nesnesini atar. |
|
İki callable nesneler arasında geçiş yap. |
|
Depolanmış Callable nesnesi, sınamaları belirtildiği gibi çağrılabilir. |
|
Alır callable nesnesinde bilgileri yazın. |
İşleçler
Saklı callable nesnesi varsa sınar. |
|
Callable nesnesi çağırır. |
|
Saklı callable nesnenin yerini alır. |
Gereksinimler
Başlık: <functional>
Namespace: std