Код для воспроизведения этой проблемы следующий.
Код: Выделить всё
#include
#include
#include
using namespace std;
int main()
{
const string data[] = {
"ElectronicDocument",
"Order",
"xs:string",
"an..10",
"DateTime",
"Date",
"DeliveryDateRequested",
"CurrencyCode",
"Party",
"BuyerParty",
"EAN - 13",
"xs:positiveInteger",
"xs:nonNegativeInteger",
"xs:integer",
"xs:decimal",
"GLN",
"Contact",
"an..35",
"EMail",
"TelephoneOrTelefaxNumber",
"Address",
"an..70",
"CityName",
"n5",
"xs:nonPositiveInteger",
"PostalCode",
"CountryCode",
"SellerParty",
"BankAccountIdentification",
"n..12",
"LineItem",
"n..5",
"GTIN",
"MonetaryAmount",
"Price",
"MonetaryAmountValue",
"Quantity",
"MeasureUnitCode",
"TotalAmount"
};
std::deque tDeque;
for (auto iter = std::begin(data); iter < std::end(data); iter++)
{
tDeque.push_back(std::make_unique(*iter));
}
std::sort(tDeque.begin(), tDeque.end(),
[](const std::unique_ptr& l, const std::unique_ptr& r) -> bool
{
return *l < *r;
});
for (auto iter = tDeque.begin(); iter < tDeque.end(); iter++)
{
cout c_str()
Подробнее здесь: [url]https://stackoverflow.com/questions/78180591/bug-when-sorting-stddeque[/url]