本文整理汇总了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);
}
示例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;
}
示例3: a
const Value& a() const
{
BOOST_STATIC_ASSERT(channels_ >= 4);
return v_[3];
}
示例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();
}
示例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());
}
示例6: get
inline CoordinateType const& get() const
{
BOOST_STATIC_ASSERT(K < DimensionCount);
return m_values[K];
}
示例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();
}
示例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);
}
示例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));
//.........这里部分代码省略.........
示例10: BOOST_STATIC_ASSERT
operator D3DXVECTOR2 *()
{
BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value));
return reinterpret_cast<D3DXVECTOR2 *>(this);
}
示例11: Vector2dC
Vector2dC(const D3DXVECTOR2 &src)
{
BOOST_STATIC_ASSERT((boost::is_same<_Type, float>::value));
set(src.x, src.y);
}
示例12: check_gray
static void check_gray() { BOOST_STATIC_ASSERT((is_same<typename Layout::color_space_t, gray_t>::value)); }
示例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);
}
示例14: flush
void flush(Device& dev)
{
BOOST_STATIC_ASSERT(is_filter<T>::value);
return iostreams::flush(t_, dev);
}
示例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);
}