/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
namespace sc
{ namespace opencl
{ namespace
{ #ifdef SAL_LOG_INFO class outputstream_num_put : public std::num_put<char>
{ protected: virtual iter_type do_put(iter_type s, std::ios_base&, char_type, double v) const override
{
std::string str = preciseFloat(v); return std::copy(str.begin(), str.end(), s);
} virtual iter_type do_put(iter_type, std::ios_base&, char_type, longdouble) const override
{
abort(); // we do not use these
} using std::num_put<char>::do_put;
}; #endif
} // namespace
outputstream::outputstream()
{
precision(DECIMAL_DIG);
setf(std::ios::showpoint); #ifdef SAL_LOG_INFO // Calling precision() makes the output have trailing insignificant zeroes, which // makes reading the source annoying. So override this stream's floating output // handling to force usage of our preciseFloat(), which has a saner output.
imbue(std::locale(std::locale("C"), new outputstream_num_put)); #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.