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
|
||||
stringid::clear (void)
|
||||
stringid::clear (void) noexcept
|
||||
{
|
||||
m_map.clear ();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::size_t
|
||||
stringid::size (void) const noexcept
|
||||
{
|
||||
return m_map.size ();
|
||||
}
|
13
stringid.hpp
13
stringid.hpp
@ -3,11 +3,12 @@
|
||||
* 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/.
|
||||
*
|
||||
* 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
|
||||
#define CRUFT_UTIL_STRINGID_HPP
|
||||
#pragma once
|
||||
|
||||
#include "view.hpp"
|
||||
|
||||
@ -63,12 +64,12 @@ namespace cruft {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
void clear (void);
|
||||
void clear (void) noexcept;
|
||||
|
||||
std::size_t size (void) const noexcept;
|
||||
|
||||
|
||||
private:
|
||||
std::map<std::string const, id_t, std::less<>> m_map;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user