PrevUpHomeNext

Ugpp c++ library


Ugpp is a c++ library to provide some basic useful features.

ugpp::vt_map, ugpp::lt_map

This project is removed, the c++ code is merged into other project.

ugpp::vt_map or ugpp::lt_map uses tuple as its element type and use std::vector or std::list as its range type.

The tuple maps do not sort elements.

#include <ugpp/vt_map.hpp>
#inlcude <iostream>

int main()
{
	ugpp::vt_map<std::string, bool, std::string, float> map{
		{"world 1", true, "A", 2.5},
		{"world 2", false, "B", 4.5}
	};
	map.set("world 3", true, "C", 7.5);
	map.set("world 2", true, "D", 9.5);
	for (const auto & [key, v1, v2, v3]: map)
	{
		std::cout << key << " => " << v1 << " " << v2 << " " << v3 << std::endl;
	}

	contract_assert(map.size() == 3u);
	contract_assert(map.find("world 2") != map.end());
	contract_assert(map.find("World 2") == map.end());
	contract_assert(map.find("world 4") == map.end());

	ugpp::vt_map map2{
		std::tuple{"world 1", true, "A", 2.5},
		{"world 2", false, "B", 4.5}
	};
}

Project

Project Start Date:

Sep 24, 2026

This project is removed, the c++ code is merged into other project.

Back

Up

Helpful

www.cppfx.tiv.cc

Role

+

Powered by:
B2 Build | boost quickbook

+

@www.cppfx.tiv.cc


















PrevUpHomeNext