本文整理汇总了C++中BOOST_STATIC_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_STATIC_ASSERT函数的具体用法?C++ BOOST_STATIC_ASSERT怎么用?C++ BOOST_STATIC_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BOOST_STATIC_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: test_no_cv
inline void test_no_cv()
{
typedef BOOST_DEDUCED_TYPENAME boost::promote<T>::type promoted;
BOOST_STATIC_ASSERT(( boost::is_same<promoted,Promoted>::value ));
}
开发者ID:LancelotGHX,项目名称:Simula,代码行数:5,代码来源:promote_util.hpp
示例17: png_read_image
inline void png_read_image(const char* filename,Image& im) {
BOOST_STATIC_ASSERT(png_read_support<typename Image::view_t>::is_supported);
detail::png_reader m(filename);
m.read_image(im);
}
开发者ID:MatGB,项目名称:freeorion,代码行数:5,代码来源:png_io.hpp
示例18: set
inline void set(CoordinateType const& value)
{
BOOST_STATIC_ASSERT(K < DimensionCount);
m_values[K] = value;
}
开发者ID:PAV38,项目名称:PDAL,代码行数:5,代码来源:point.hpp
示例19: BOOST_STATIC_ASSERT
inline uint32_t Write<float>(const float& f)
{
BOOST_STATIC_ASSERT(sizeof(float)==4);
fwrite(&f,4,1,out);
return 4;
}
开发者ID:gzorin,项目名称:assimp,代码行数:6,代码来源:WriteDumb.cpp
示例20: get_binary_right_subject
inline typename binary_right_subject<BinaryT>::type const &
get_binary_right_subject(BinaryT const &binary_)
{
BOOST_STATIC_ASSERT(::boost::spirit::is_binary_composite<BinaryT>::value);
return binary_.right();
}
开发者ID:4eek,项目名称:xtractorfan,代码行数:6,代码来源:parser_traits.hpp
注:本文中的BOOST_STATIC_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论