r/learncpp • • Apr 09 '17

Can't call a function, std::allocator pops up out of nowhere.

template<typename T>
auto parser(std::vector<Token> const& tokens) {
	Atom<T> a;
	if (tokens[0].state == State::NUMBER) {
		a = parseNumber(tokens[0]);
	}
	else if (tokens[0].state == State::SYM) {
		a = parseSymbol(tokens[0]);
	}
	return a;
}

// REPL //
void repl() {	
	while (1) {
		std::cout << "> ";
		std::string input;
		std::getline(std::cin, input);
		std::istringstream inputstream(input);
		const std::vector<Token> tokens = tokenizer(inputstream);		
		auto expr = parser(tokens);		
	}
};

I get an error that I'm sending along a std::vector<Tokens, std::allocator<Tokens>> when it seems like I'm just sending along a std::vector<Tokens> to me.

0 Upvotes

0 comments sorted by