簡體   English   中英

“…”標記之前的預期類型說明符

[英]expected type-specifier before '…' token

expected type-specifier before '...' token

這是代碼

template< typename T, int t_nFixedBytes = 128, class Allocator = CCRTAllocator >
class CTempBuffer
{
public:
    CTempBuffer() throw() :
        m_p( NULL )
    {
    }
    CTempBuffer( size_t nElements )   throw( ... ) : <---ERROR HERE
        m_p( NULL )
    {
        Allocate( nElements );
    }
...
}

現在如果我擺脫了上面的聲明中的throw(...),這個錯誤就解決了。關於Mingw為什么不喜歡throw(...)

實際上, throw(...)不是標准的c ++語法,而是特定於MSVC ++的擴展。 這僅表示此函數可以引發任何異常,這等效於根本沒有異常規范,因此您可以安全地刪除它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM