當前位置: 首頁>>代碼示例>>C++>>正文


C++ BOOST_STATIC_ASSERT函數代碼示例

本文整理匯總了C++中BOOST_STATIC_ASSERT函數的典型用法代碼示例。如果您正苦於以下問題:C++ BOOST_STATIC_ASSERT函數的具體用法?C++ BOOST_STATIC_ASSERT怎麽用?C++ BOOST_STATIC_ASSERT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BOOST_STATIC_ASSERT函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: read_int

	inline T read_int(InIterator& start, bool advance=true, std::size_t bytesize=sizeof(T))
	{
		BOOST_STATIC_ASSERT(boost::is_float<T>::value||boost::is_integral<T>::value);
		return read_value<T>(start,advance,bytesize);
	}
開發者ID:JingSao,項目名稱:p2engine,代碼行數:5,代碼來源:io.hpp

示例2: encypher_block

    static block_type
    encypher_block(schedule_type const &schedule,
                   block_type const &plaintext) {

#ifdef BOOST_HASH_SHOW_PROGRESS
        for (unsigned t = 0; t < block_words; ++t) {
            std::printf(word_bits == 32 ?
                        "H[%d] = %.8x\n" :
                        "H[%d] = %.16lx\n",
                        t, plaintext[t]);
        }
#endif

        // Initialize working variables with block
        word_type a = plaintext[0], b = plaintext[1],
                  c = plaintext[2], d = plaintext[3],
                  e = plaintext[4], f = plaintext[5],
                  g = plaintext[6], h = plaintext[7];

        // Encypher block
#ifdef BOOST_HASH_NO_OPTIMIZATION

        for (unsigned t = 0; t < rounds; ++t) {
            word_type T1 = h
                         + policy_type::Sigma_1(e)
                         + policy_type::Ch(e, f, g)
                         + policy_type::constant(t)
                         + schedule[t];
            word_type T2 = policy_type::Sigma_0(a)
                         + policy_type::Maj(a, b, c);

            h = g;
            g = f;
            f = e;
            e = d + T1;
            d = c;
            c = b;
            b = a;
            a = T1 + T2;

#ifdef BOOST_HASH_SHOW_PROGRESS
            std::printf(word_bits == 32 ?
                        "t = %2d: %.8x %.8x %.8x %.8x"
                                " %.8x %.8x %.8x %.8x\n" :
                        "t = %2d: %.16lx %.16lx %.16lx %.16lx"
                                " %.16lx %.16lx %.16lx %.16lx\n",
                        t, a, b, c, d,
                           e, f, g, h);
#endif
        }

#else // BOOST_HASH_NO_OPTIMIZATION

        BOOST_STATIC_ASSERT(rounds % block_words == 0);
        for (unsigned t = 0; t < rounds; ) {
            for (int n = block_words; n--; ++t) {
                word_type T1 = h
                             + policy_type::Sigma_1(e)
                             + policy_type::Ch(e, f, g)
                             + policy_type::constant(t)
                             + schedule[t];
                word_type T2 = policy_type::Sigma_0(a)
                             + policy_type::Maj(a, b, c);

                h = g;
                g = f;
                f = e;
                e = d + T1;
                d = c;
                c = b;
                b = a;
                a = T1 + T2;

#ifdef BOOST_HASH_SHOW_PROGRESS
                std::printf(word_bits == 32 ?
                            "t = %2d: %.8x %.8x %.8x %.8x"
                                    " %.8x %.8x %.8x %.8x\n" :
                            "t = %2d: %.16lx %.16lx %.16lx %.16lx"
                                    " %.16lx %.16lx %.16lx %.16lx\n",
                            t, a, b, c, d,
                               e, f, g, h);
#endif
            }
        }

#endif

        block_type cyphertext = {{a, b, c, d, e, f, g, h}};
        return cyphertext;
    }
開發者ID:OSUser,項目名稱:avbot,代碼行數:90,代碼來源:shacal2.hpp

示例3: a

 const Value& a() const
 {
   BOOST_STATIC_ASSERT(channels_ >= 4);
   return v_[3];
 }
開發者ID:aeickho,項目名稱:Tomo,代碼行數:5,代碼來源:Color.hpp

示例4: get_action_subject

inline typename action_subject<ActionT>::type const &
get_action_subject(ActionT const &action_)
{
    BOOST_STATIC_ASSERT(::boost::spirit::is_action_parser<ActionT>::value);
    return action_.subject();
}
開發者ID:4eek,項目名稱:xtractorfan,代碼行數:6,代碼來源:parser_traits.hpp

示例5: is_linked

 bool is_linked() const
 {
    //is_linked() can be only used in safe-mode or auto-unlink
    BOOST_STATIC_ASSERT(( boost_intrusive_tags::safemode_or_autounlink ));
    return !node_algorithms::unique(this->this_ptr());
 }
開發者ID:jsherer,項目名稱:BoostIntrusiveAnnotatedTrees,代碼行數:6,代碼來源:generic_hook.hpp

示例6: get

 inline CoordinateType const& get() const
 {
     BOOST_STATIC_ASSERT(K < DimensionCount);
     return m_values[K];
 }
開發者ID:PAV38,項目名稱:PDAL,代碼行數:5,代碼來源:point.hpp

示例7: get_unary_subject

inline typename unary_subject<UnaryT>::type const &
get_unary_subject(UnaryT const &unary_)
{
    BOOST_STATIC_ASSERT(::boost::spirit::is_unary_composite<UnaryT>::value);
    return unary_.subject();
}
開發者ID:4eek,項目名稱:xtractorfan,代碼行數:6,代碼來源:parser_traits.hpp

示例8: atomic

 atomic(T a = 0): m_value(a) {
     // For now we just support 32bit signed and unsigned ints
     BOOST_STATIC_ASSERT(sizeof(T) == 4);
 }
開發者ID:fenollp,項目名稱:eixx,代碼行數:4,代碼來源:common.hpp

示例9: CreateSimpleStatusBar

LRESULT PublicHubsFrame::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
{
	CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SBARS_SIZEGRIP);
	ctrlStatus.Attach(m_hWndStatusBar);
	
	int w[3] = { 0, 0, 0 };
	ctrlStatus.SetParts(3, w);
	
	m_ctrlHubs.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                  WS_HSCROLL | WS_VSCROLL | LVS_REPORT | LVS_SHOWSELALWAYS |
	                  LVS_SHAREIMAGELISTS, // https://github.com/pavel-pimenov/flylinkdc-r5xx/issues/1611
	                  WS_EX_CLIENTEDGE, IDC_HUBLIST);
	SET_EXTENDENT_LIST_VIEW_STYLE(m_ctrlHubs);
	
	// Create listview columns
	WinUtil::splitTokens(columnIndexes, SETTING(PUBLICHUBSFRAME_ORDER), COLUMN_LAST);
	WinUtil::splitTokensWidth(columnSizes, SETTING(PUBLICHUBSFRAME_WIDTHS), COLUMN_LAST);
	
	BOOST_STATIC_ASSERT(_countof(columnSizes) == COLUMN_LAST);
	BOOST_STATIC_ASSERT(_countof(columnNames) == COLUMN_LAST);
	for (int j = 0; j < COLUMN_LAST; j++)
	{
		const int fmt = (j == COLUMN_USERS) ? LVCFMT_RIGHT : LVCFMT_LEFT;
		m_ctrlHubs.InsertColumn(j, CTSTRING_I(columnNames[j]), fmt, columnSizes[j], j);
	}
	
	m_ctrlHubs.SetColumnOrderArray(COLUMN_LAST, columnIndexes);
	
	SET_LIST_COLOR(m_ctrlHubs);
	
	m_ctrlHubs.SetImageList(g_flagImage.getIconList(), LVSIL_SMALL);
	
	/*  extern HIconWrapper g_hOfflineIco;
	  extern HIconWrapper g_hOnlineIco;
	    m_onlineStatusImg.Create(16, 16, ILC_COLOR32 | ILC_MASK,  0, 2);
	    m_onlineStatusImg.AddIcon(g_hOnlineIco);
	    m_onlineStatusImg.AddIcon(g_hOfflineIco);
	  m_ctrlHubs.SetImageList(m_onlineStatusImg, LVSIL_SMALL);
	*/
	ClientManager::getOnlineClients(m_onlineHubs);
	
	m_ctrlHubs.SetFocus();
	
	m_ctrlTree.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP, WS_EX_CLIENTEDGE, IDC_ISP_TREE);
	m_ctrlTree.SetBkColor(Colors::g_bgColor);
	m_ctrlTree.SetTextColor(Colors::g_textColor);
	WinUtil::SetWindowThemeExplorer(m_ctrlTree.m_hWnd);
	
	m_treeContainer.SubclassWindow(m_ctrlTree);
	
	
	SetSplitterExtendedStyle(SPLIT_PROPORTIONAL); // При изменении размеров окна-контейнера размеры разделяемых областей меняются пропорционально.
	SetSplitterPanes(m_ctrlTree.m_hWnd, m_ctrlHubs.m_hWnd);
	m_nProportionalPos = SETTING(FLYSERVER_HUBLIST_SPLIT);
	
	ctrlConfigure.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                     BS_PUSHBUTTON , 0, IDC_PUB_LIST_CONFIG);
	ctrlConfigure.SetWindowText(CTSTRING(CONFIGURE));
	ctrlConfigure.SetFont(Fonts::g_systemFont);
	
	ctrlFilter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                  ES_AUTOHSCROLL, WS_EX_CLIENTEDGE);
	m_filterContainer.SubclassWindow(ctrlFilter.m_hWnd);
	ctrlFilter.SetFont(Fonts::g_systemFont);
	
	ctrlFilterSel.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                     WS_HSCROLL | WS_VSCROLL | CBS_DROPDOWNLIST, WS_EX_CLIENTEDGE);
	ctrlFilterSel.SetFont(Fonts::g_systemFont, FALSE);
	
	//populate the filter list with the column names
	for (int j = 0; j < COLUMN_LAST; j++)
	{
		ctrlFilterSel.AddString(CTSTRING_I(columnNames[j]));
	}
	ctrlFilterSel.AddString(CTSTRING(ANY));
	ctrlFilterSel.SetCurSel(COLUMN_LAST);
	
	ctrlFilterDesc.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
	                      BS_GROUPBOX, WS_EX_TRANSPARENT);
	ctrlFilterDesc.SetWindowText(CTSTRING(FILTER));
	ctrlFilterDesc.SetFont(Fonts::g_systemFont);
	
	SettingsManager::getInstance()->addListener(this);
	
	updateList();
	loadISPHubs();
	m_ctrlHubs.setSort(COLUMN_USERS, ExListViewCtrl::SORT_INT, false);
	/*  const int l_sort = SETTING(HUBS_PUBLIC_COLUMNS_SORT);
	    int l_sort_type = ExListViewCtrl::SORT_STRING_NOCASE;
	    if (l_sort == 2 || l_sort > 4)
	        l_sort_type = ExListViewCtrl::SORT_INT;
	    if (l_sort == 5)
	        l_sort_type = ExListViewCtrl::SORT_BYTES;
	    m_ctrlHubs.setSort(SETTING(HUBS_PUBLIC_COLUMNS_SORT), l_sort_type, BOOLSETTING(HUBS_PUBLIC_COLUMNS_SORT_ASC));
	*/
	hubsMenu.CreatePopupMenu();
	hubsMenu.AppendMenu(MF_STRING, IDC_CONNECT, CTSTRING(CONNECT));
	hubsMenu.AppendMenu(MF_STRING, IDC_ADD, CTSTRING(ADD_TO_FAVORITES_HUBS));
	hubsMenu.AppendMenu(MF_STRING, IDC_REM_AS_FAVORITE, CTSTRING(REMOVE_FROM_FAVORITES_HUBS));
	hubsMenu.AppendMenu(MF_STRING, IDC_COPY_HUB, CTSTRING(COPY_HUB));
//.........這裏部分代碼省略.........
開發者ID:craxycat,項目名稱:flylinkdc-r5xx,代碼行數:101,代碼來源:PublicHubsFrm.cpp

示例10: BOOST_STATIC_ASSERT

		operator D3DXVECTOR2 *()
		{
			BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value));
			return reinterpret_cast<D3DXVECTOR2 *>(this);
		}
開發者ID:Emulyator,項目名稱:gamecatapult,代碼行數:5,代碼來源:vector2d.hpp

示例11: Vector2dC

		Vector2dC(const D3DXVECTOR2 &src)
		{
			BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value));
			set(src.x, src.y);
		}
開發者ID:Emulyator,項目名稱:gamecatapult,代碼行數:5,代碼來源:vector2d.hpp

示例12: check_gray

 static void check_gray() {  BOOST_STATIC_ASSERT((is_same<typename Layout::color_space_t, gray_t>::value)); }
開發者ID:Skovpin,項目名稱:CodeBlocks-RG,代碼行數:1,代碼來源:pixel.hpp

示例13: write_int

	inline void write_int(T val, OutIterator& start,bool advance=true,std::size_t bytesize=sizeof(T))
	{
		BOOST_STATIC_ASSERT(boost::is_float<T>::value||boost::is_integral<T>::value);
		return write_value<T>(val,start,advance,bytesize);
	}
開發者ID:JingSao,項目名稱:p2engine,代碼行數:5,代碼來源:io.hpp

示例14: flush

 void flush(Device& dev) 
 { 
     BOOST_STATIC_ASSERT(is_filter<T>::value);
     return iostreams::flush(t_, dev); 
 }
開發者ID:Albermg7,項目名稱:boost,代碼行數:5,代碼來源:basic_adapter.hpp

示例15: png_read_view

inline void png_read_view(const char* filename,const View& view) {
    BOOST_STATIC_ASSERT(png_read_support<View>::is_supported);
    detail::png_reader m(filename);
    m.apply(view);
}
開發者ID:MatGB,項目名稱:freeorion,代碼行數:5,代碼來源:png_io.hpp


注:本文中的BOOST_STATIC_ASSERT函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。