TT Client Library 1.0.0
C++ library for Tandem Tales clients.
Loading...
Searching...
No Matches
Util.h
1#include <tt/util/JsonUtil.h>
2
3#pragma once
4
5#ifndef UTIL_H
6#define UTIL_H
7
8// this is a space for any utility functions I need
9namespace tt {
18 inline void requireNonEmpty(const std::string& s, const std::string& description) {
19 if (s.empty())
20 throw std::invalid_argument(description + " cannot be empty");
21 }
22
31 template <typename T>
32 inline void requireNonNegative(const T& x, const std::string& description) {
33 if (x < 0)
34 throw std::invalid_argument(description + " cannot be negative");
35 }
36}
37
38
39#endif
Tandem Tales is a platform that enables short, paired storytelling exercises between two agents over ...
Definition Client.h:22
void requireNonEmpty(const std::string &s, const std::string &description)
Throws an exception if the given string is empty.
Definition Util.h:18
void requireNonNegative(const T &x, const std::string &description)
Throws an exception if the given number is less than 0.
Definition Util.h:32