Emulate std::to_string on platforms that do not provide it
Inspired by NFD commit ce81230b09583f9aec98a97653a047aa54fa2bef
This commit also fixes an important typo in the name of the macro
defined by the check_vector_const_iterators configure check.
Change-Id: I1b18066474145720570b5ecd6109b3f76eb262e8
Refs: #2743
diff --git a/src/lp/detail/field-decl.hpp b/src/lp/detail/field-decl.hpp
index 0738768..6804b8a 100644
--- a/src/lp/detail/field-decl.hpp
+++ b/src/lp/detail/field-decl.hpp
@@ -44,7 +44,7 @@
decode(const Block& wire)
{
if (wire.type() != TlvType::value) {
- BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV type " + std::to_string(wire.type())));
+ BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV type " + to_string(wire.type())));
}
T type;
@@ -60,7 +60,7 @@
decode(const Block& wire)
{
if (wire.type() != TlvType::value) {
- BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV type " + std::to_string(wire.type())));
+ BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV type " + to_string(wire.type())));
}
return readNonNegativeInteger(wire);
@@ -74,11 +74,11 @@
decode(const Block& wire)
{
if (wire.type() != TlvType::value) {
- BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV type " + std::to_string(wire.type())));
+ BOOST_THROW_EXCEPTION(ndn::tlv::Error("Unexpected TLV type " + to_string(wire.type())));
}
if (wire.value_size() == 0) {
- BOOST_THROW_EXCEPTION(ndn::tlv::Error(std::to_string(wire.type()) + " must not be empty"));
+ BOOST_THROW_EXCEPTION(ndn::tlv::Error(to_string(wire.type()) + " must not be empty"));
}
return std::make_pair(wire.value_begin(), wire.value_end());