mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-10 04:33:59 +01:00
refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17)
Removes the macro ARRAYLEN and also substitutes all other uses of the same "sizeof(a)/sizeof(a[0])" pattern by std::size, available since C++17.
This commit is contained in:
@@ -16,7 +16,7 @@ BOOST_AUTO_TEST_CASE(base64_testvectors)
|
||||
{
|
||||
static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"};
|
||||
static const std::string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"};
|
||||
for (unsigned int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++)
|
||||
for (unsigned int i=0; i<std::size(vstrIn); i++)
|
||||
{
|
||||
std::string strEnc = EncodeBase64(vstrIn[i]);
|
||||
BOOST_CHECK_EQUAL(strEnc, vstrOut[i]);
|
||||
|
||||
Reference in New Issue
Block a user