#include <boost/format.hpp>
#include <string>
#include <stdexcept>
#include <iostream>
int N_size_file = 5000;
int N_MAX = 4500;
void f()
{
    if(N_size_file > N_MAX)
        throw std::runtime_error( str(boost::format(
            "check(): Hidden node count of %d exceeds maximum allowed value of %d ")
            % N_size_file % N_MAX));
}
int main()
{
    try {
        f();
    } catch(const std::exception& e) {
        std::cout << "Caught exception: " << e.what() << '\n';
    }
}