Start moving away from the Java-like containers.
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled

This commit is contained in:
2025-08-06 03:16:31 -04:00
parent af0c428934
commit 23f82a705c
3 changed files with 45 additions and 26 deletions

View File

@ -22,6 +22,15 @@
#define __LOUT_CONTAINER_HH_
#include "object.hh"
#include <Alepha/Concepts.h>
// TODO: Over time I'll have to retire the Java-like containers here.
// For now, a few of the "niceties" they offer should be wrapped and/or
// adapted.
#include <list>
#include <vector>
#include <map>
#include <unordered_map>
namespace lout {
@ -39,6 +48,21 @@ namespace lout {
*/
namespace container {
template< Alepha::DerivedFrom< object::Object > T >
void
intoStringBuffer( const std::list< T * > &container, misc::StringBuffer *const sb )
{
sb->append("{ ");
bool first= true;
for( auto *object: container )
{
if( not first ) sb->append(", ");
object->intoStringBuffer(sb);
first = false;
}
sb->append(" }");
}
/**
* \brief The container classes defined here contain instances of
* object::Object.