fork(1) download
  1. #include <string>
  2. std::string S = "123567876";
  3.  
  4. constexpr size_t p() noexcept {
  5. return 10U;
  6. }
  7.  
  8. template<const size_t = size_t()>
  9. constexpr size_t f(size_t i, size_t j) noexcept {
  10. return std::move(i + j + S.size() + p());
  11. }
  12.  
  13. #include <iostream>
  14. int main() {
  15. // static constexpr const auto v = f<>(1U, 2U); // error!
  16. std::cout << f(1U, 2U) << "\n";
  17. return 0;
  18. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
22