I love C++! :D
#include <iostream>
#include <type_traits>

/**
* @brief Generic meta-combinator for layered template evaluation.
*
* Combines two template-level value providers (A and B) to enable
* multi-phase compile-time composition.
*/
template<template<typename> class A, template<typename> class B, typename T>
struct Combine {
using type = typename B<T>::type;
static constexpr auto value = A<T>::value + B<T>::value;
};

/**
* @brief Base meta-wrapper exposing a compile-time value.
*/
template<typename T>
struct Wrapper {
using type = T;
static constexpr T value = 0;
};

/**
* @brief Incremental meta-transformer providing a constant offset.
*
* Can be extended for custom numeric promotion logic.
*/
template<typename T>
struct Increment {
using type = T;
static constexpr T value = 1;
};

/**
* @brief Higher-level aggregation of template-based numeric traits.
*
* Demonstrates meta-layered composition patterns using
* template-of-template parameters.
*/
template<template<typename> class A, template<typename> class B, typename T, int N>
struct Final : Combine<A, B, T> {
static constexpr auto value = Combine<A, B, T>::value + N;
using type = typename Combine<A, B, T>::type;
};

int main() {
using Computation = Final<Increment, Wrapper, int, 41>;
std::cout << Computation::value << std::endl;
}