remove lexical cast, its evil

This commit is contained in:
Dane Springmeyer
2013-05-14 20:12:47 -07:00
parent 6d61e950d6
commit 556b498e06
3 changed files with 4 additions and 4 deletions
+4 -2
View File
@@ -21,8 +21,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
#ifndef BASIC_DATASTRUCTURES_H
#define BASIC_DATASTRUCTURES_H
#include <string>
#include <sstream>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "../Util/StringUtil.h"
@@ -143,7 +143,9 @@ Reply Reply::stockReply(Reply::status_type status) {
rep.headers[0].name = "Access-Control-Allow-Origin";
rep.headers[0].value = "*";
rep.headers[1].name = "Content-Length";
rep.headers[1].value = boost::lexical_cast<std::string>(rep.content.size());
std::ostringstream s;
s << rep.content.size();
rep.headers[1].value = s.str();
rep.headers[2].name = "Content-Type";
rep.headers[2].value = "text/html";
return rep;
-1
View File
@@ -25,7 +25,6 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <cctype> // std::tolower
#include <string>
#include <iostream>
#include <boost/lexical_cast.hpp>
#include <boost/noncopyable.hpp>
#include "APIGrammar.h"