We "using namespace std" anywhere we need a std::string or a std::vector.
double rate_;
Stopwatch stopwatch_;
const size_t N;
- std::queue<double> times_;
+ queue<double> times_;
int last_update_;
};
};
#endif // NINJA_BUILD_H_
-
int m = s1.len_;
int n = s2.len_;
- std::vector<int> previous(n + 1);
- std::vector<int> current(n + 1);
+ vector<int> previous(n + 1);
+ vector<int> current(n + 1);
for (int i = 0; i <= n; ++i)
previous[i] = i;
#endif
}
-void LinePrinter::Print(std::string to_print, LineType type) {
+void LinePrinter::Print(string to_print, LineType type) {
#ifdef _WIN32
CONSOLE_SCREEN_BUFFER_INFO csbi;
GetConsoleScreenBufferInfo(console_, &csbi);
#define NINJA_LINE_PRINTER_H_
#include <string>
+using namespace std;
/// Prints lines of text, possibly overprinting previously printed lines
/// if the terminal supports it.
};
/// Overprints the current line. If type is ELIDE, elides to_print to fit on
/// one line.
- void Print(std::string to_print, LineType type);
+ void Print(string to_print, LineType type);
/// Prints a string on a new line, not overprinting previous output.
- void PrintOnNewLine(const std::string& to_print);
+ void PrintOnNewLine(const string& to_print);
private:
/// Whether we can do fancy terminal control codes.
"default $third\n"));
string err;
- std::vector<Node*> nodes = state.DefaultNodes(&err);
+ vector<Node*> nodes = state.DefaultNodes(&err);
EXPECT_EQ("", err);
ASSERT_EQ(3u, nodes.size());
EXPECT_EQ("a", nodes[0]->path());
#include "gtest/gtest.h"
#include "line_printer.h"
-std::string StringPrintf(const char* format, ...) {
+string StringPrintf(const char* format, ...) {
const int N = 1024;
char buf[N];
}
TEST(CanonicalizePath, UpDir) {
- std::string path, err;
+ string path, err;
path = "../../foo/bar.h";
EXPECT_TRUE(CanonicalizePath(&path, &err));
EXPECT_EQ("../../foo/bar.h", path);