We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This is a workaround, not a solution. The whole point of the private load member is to keep track of the number of times that Server::compute() is called. The bad_alloc exception should occur upon a failure of Server::compute. If T is large enough, conceivably the system could run out of memory even when A is less than 1073741823.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Exceptional Server
You are viewing a single comment's thread. Return to all comments →
This is a workaround, not a solution. The whole point of the private load member is to keep track of the number of times that Server::compute() is called. The bad_alloc exception should occur upon a failure of Server::compute. If T is large enough, conceivably the system could run out of memory even when A is less than 1073741823.