本文整理汇总了C++中std::array::front方法的典型用法代码示例。如果您正苦于以下问题:C++ array::front方法的具体用法?C++ array::front怎么用?C++ array::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::array
的用法示例。
在下文中一共展示了array::front方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
VT00WindowBuffer(int x, int y, int width, int height) :_x(x),_y(y),_width(width),_height(height), _scroll(true), _handle(nullptr) {
// configure handle
update_handle();
// configure charater buffer
setg(&_input.front(), &_input.front(), &_input.back() - 1);
setp(&_output.front(), &_output.back() - 1);
}
示例2: getSizes
static const std::array<size_t, 14> & getSizes()
{
static constexpr std::array<size_t, 14> sizes{
8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536
};
static_assert(sizes.front() >= sizeof(Block), "Can't make allocations smaller than sizeof(Block)");
return sizes;
}
示例3: doAccountObjects
Json::Value doAccountObjects (RPC::Context& context)
{
auto const& params = context.params;
if (! params.isMember (jss::account))
return RPC::missing_field_error (jss::account);
std::shared_ptr<ReadView const> ledger;
auto result = RPC::lookupLedger (ledger, context);
if (ledger == nullptr)
return result;
AccountID accountID;
{
auto const strIdent = params[jss::account].asString ();
if (auto jv = RPC::accountFromString (accountID, strIdent))
{
for (auto it = jv.begin (); it != jv.end (); ++it)
result[it.memberName ()] = it.key ();
return result;
}
}
if (! ledger->exists(keylet::account (accountID)))
return rpcError (rpcACT_NOT_FOUND);
auto type = ltINVALID;
if (params.isMember (jss::type))
{
static
std::array<std::pair<char const *, LedgerEntryType>, 9> const
types
{{
{ jss::account, ltACCOUNT_ROOT },
{ jss::amendments, ltAMENDMENTS },
{ jss::directory, ltDIR_NODE },
{ jss::fee, ltFEE_SETTINGS },
{ jss::hashes, ltLEDGER_HASHES },
{ jss::offer, ltOFFER },
{ jss::signer_list, ltSIGNER_LIST },
{ jss::state, ltRIPPLE_STATE },
{ jss::ticket, ltTICKET }
}
};
auto const& p = params[jss::type];
if (! p.isString ())
return RPC::expected_field_error (jss::type, "string");
auto const filter = p.asString ();
auto iter = std::find_if (types.begin (), types.end (),
[&filter](decltype (types.front ())& t)
{
return t.first == filter;
});
if (iter == types.end ())
return RPC::invalid_field_error (jss::type);
type = iter->second;
}
unsigned int limit;
if (auto err = readLimitField(limit, RPC::Tuning::accountObjects, context))
return *err;
uint256 dirIndex;
uint256 entryIndex;
if (params.isMember (jss::marker))
{
auto const& marker = params[jss::marker];
if (! marker.isString ())
return RPC::expected_field_error (jss::marker, "string");
std::stringstream ss (marker.asString ());
std::string s;
if (!std::getline(ss, s, ','))
return RPC::invalid_field_error (jss::marker);
if (! dirIndex.SetHex (s))
return RPC::invalid_field_error (jss::marker);
if (! std::getline (ss, s, ','))
return RPC::invalid_field_error (jss::marker);
if (! entryIndex.SetHex (s))
return RPC::invalid_field_error (jss::marker);
}
if (! RPC::getAccountObjects (*ledger, accountID, type,
dirIndex, entryIndex, limit, result))
{
result[jss::account_objects] = Json::arrayValue;
}
result[jss::account] = context.app.accountIDCache().toBase58 (accountID);
context.loadType = Resource::feeMediumBurdenRPC;
return result;
}
示例4: ExtractProc
//.........这里部分代码省略.........
const int x_save = x + 200;
int y_save = y;
ExtractGroupSave.Create(hWnd, _T("Destination"), ID++, x_save + 50, y_save += 34, 290, 110);
ExtractRadioSave.Close();
ExtractRadioSave.Create(hWnd, _T("Specify each time"), ID++, x_save + xx + 50, y_save += 18, 220, 20);
ExtractRadioSave.Create(hWnd, _T("Same folder as input source"), ID++, x_save + xx + 50, y_save += 20, 200, 20);
ExtractRadioSave.Create(hWnd, _T("The following folder"), ID++, x_save + xx + 50, y_save += 20, 200, 20);
ExtractRadioSave.SetCheck(0, pOption->bSaveSel);
ExtractRadioSave.SetCheck(1, pOption->bSaveSrc);
ExtractRadioSave.SetCheck(2, pOption->bSaveDir);
ExtractEditSave.Create(hWnd, pOption->SaveDir, ID++, x_save + xx * 2 + 40, y_save += 20, 200, 22);
ExtractEditSave.Enable(pOption->bSaveDir);
ExtractBtnSave.Create(hWnd, _T("Browse"), ID++, x_save + xx * 2 + 250, y_save + 1, 50, 20);
ExtractBtnSave.Enable(pOption->bSaveDir);
//
y = (y_image > y_save) ? y_image : y_save;
ExtractLabelBuf.Create(hWnd, _T("Buffer Size(KB)"), ID++, x, y += 44, 100, 20);
ExtractEditBuf.Create(hWnd, pOption->BufSize, ID++, x + 100, y - 4, 110, 22);
//
ExtractLabelTmp.Create(hWnd, _T("Temporary Folder"), ID++, x, y += 24, 100, 20);
ExtractEditTmp.Create(hWnd, pOption->TmpDir, ID++, x + 100, y - 4, 200, 22);
ExtractBtnTmp.Create(hWnd, _T("Browse"), ID++, x + 310, y - 3, 50, 20);
break;
}
case WM_COMMAND:
// Checkbox
if (LOWORD(wp) >= ExtractCheck.front().GetID() && LOWORD(wp) <= ExtractCheck.back().GetID())
{
PropSheet_Changed(::GetParent(hWnd), hWnd);
break;
}
// Alpha blend check box
if (LOWORD(wp) == ExtractCheckAlpha.GetID())
{
ExtractEditAlpha.Enable(ExtractCheckAlpha.GetCheck());
PropSheet_Changed(::GetParent(hWnd), hWnd);
break;
}
//Output image format radio button
if (LOWORD(wp) >= ExtractRadioImage.GetID(0) && LOWORD(wp) <= ExtractRadioImage.GetID(1))
{
PropSheet_Changed(::GetParent(hWnd), hWnd);
break;
}
// Destination radio button
if (LOWORD(wp) >= ExtractRadioSave.GetID(0) && LOWORD(wp) <= ExtractRadioSave.GetID(2))
{
ExtractEditSave.Enable(ExtractRadioSave.GetCheck(2));
ExtractBtnSave.Enable(ExtractRadioSave.GetCheck(2));
PropSheet_Changed(::GetParent(hWnd), hWnd);
break;
}
// Output folder browse
if (LOWORD(wp) == ExtractBtnSave.GetID())
{