stringid: implement the size query
This commit is contained in:
parent
ef24f0bfda
commit
2b7dd99a68
10
stringid.cpp
10
stringid.cpp
@ -54,7 +54,15 @@ stringid::find (std::string_view const &key) const
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void
|
void
|
||||||
stringid::clear (void)
|
stringid::clear (void) noexcept
|
||||||
{
|
{
|
||||||
m_map.clear ();
|
m_map.clear ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
std::size_t
|
||||||
|
stringid::size (void) const noexcept
|
||||||
|
{
|
||||||
|
return m_map.size ();
|
||||||
|
}
|
15
stringid.hpp
15
stringid.hpp
@ -3,11 +3,12 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
*
|
*
|
||||||
* Copyright 2014-2018 Danny Robson <danny@nerdcruft.net>
|
* Copyright:
|
||||||
|
* 2014-2018 Danny Robson <danny@nerdcruft.net>
|
||||||
|
* 2022 Danny Robson <danny@nerdcruft.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CRUFT_UTIL_STRINGID_HPP
|
#pragma once
|
||||||
#define CRUFT_UTIL_STRINGID_HPP
|
|
||||||
|
|
||||||
#include "view.hpp"
|
#include "view.hpp"
|
||||||
|
|
||||||
@ -63,12 +64,12 @@ namespace cruft {
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
void clear (void);
|
void clear (void) noexcept;
|
||||||
|
|
||||||
|
std::size_t size (void) const noexcept;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::map<std::string const, id_t, std::less<>> m_map;
|
std::map<std::string const, id_t, std::less<>> m_map;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
Loading…
Reference in New Issue
Block a user