std::pairHere is a very interesting article that compares both alternatives.
Serial.begin(115200);
std::pair
std::pair <int, char *>
std::pair <int, char *> testPair(10, "hello world");
Serial.println(testPair.first); Serial.println(testPair.second);
testPair.first = 30; testPair.second = "New value";
Serial.println(testPair.first); Serial.println(testPair.second);
void setup() { Serial.begin(115200); std::pair <int, char *> testPair(10, "hello world"); Serial.println(testPair.first); Serial.println(testPair.second); testPair.first = 30; testPair.second = "New value"; Serial.println("---------------"); Serial.println(testPair.first); Serial.println(testPair.second); } void loop() {}