This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Challenge: Concatenate Strings | |
// This coding challenge involves creating a C++ class template called strOps. | |
// The goal is to concatenate a variable number of strings using variadic | |
// templates and fold expressions, count the total number of characters in the | |
// concatenated string, and keep track of the total number of input strings. | |
// Key Concepts: | |
// 1. Utilizing variadic templates to accept a variable number of input strings. | |
// 2. Implementing fold expressions to efficiently concatenate strings. | |
// 3. Utilizing variadic variable templates to count the total number of input |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://godbolt.org/z/4xh9KEzx8 | |
#include <iostream> | |
namespace as { | |
struct lifetime { | |
lifetime() { std::cout << "lifetime default constructor\n"; } | |
lifetime(const lifetime &) { std::cout << "lifetime copy constructor\n"; } | |
lifetime(lifetime &&) noexcept { | |
std::cout << "lifetime move constructor\n"; | |
} |