fmt Questions
1
Solved
I am using the neat fmt library, which in its version 8, does compile-time checking of its format string if the compiler supports the relevant features.
I would, at some point, like to write the fo...
3
Solved
I'm wanting to use std::format but Visual Studio says the std namespace has no member format.
It appears this is new for C++20. Is there a way to make it available?
Spotlight asked 2/5, 2020 at 14:51
3
I'm trying to use the fmt (https://github.com/fmtlib/fmt) formatting header library in my c++ project.
I've added the path to the core header file at the top of my main file like so:
#include "....
2
Solved
Is it possible to format number with thousands separator using fmt?
e.g. something like this:
int count = 10000;
fmt::print("{:10}\n", count);
update
I am researching fmt, so I am looking for ...
3
Solved
I know it is possible to use the fmt formatting library in header-only mode:
How to use fmt library in the header-only mode?
but - why isn't it just header-only, period? That is, what's the benefit...
Elmore asked 15/6, 2021 at 20:32
1
Solved
I have a simple class that has a tostring() method:
class MyClass {
public:
std::string tostring() const;
static iterator begin();
static iterator end();
};
Although I'm using the fmt librar...
1
Solved
Having a hard time using the header-only mode of fmt library. Here is what I tried in details:
I downloaded fmt7.1.3 from https://fmt.dev/latest/index.html, only put the directory fmt-7.1.3/include...
1
Solved
I have a CMake project, with following structure:
cmake_minimum_required(VERSION 3.11)
project(ReadGraph)
# Download and unpack googletest at configure time
configure_file(CMakeLists.txt.in google...
1
Solved
I'd like to create a simple log function in C++ which prepend the code location to the log message. I'd like to avoid macros overall as well as the usage of __FILE__ & __LINE__.
Note that the f...
Epirus asked 25/2, 2021 at 21:16
1
Solved
I am using the {fmt} library to format strings and numeric values but I have problem with negative integers.
When I pad the value with zeroes, I expect a consistent number of zero no matter the sig...
Oral asked 11/10, 2020 at 15:40
1
Solved
I use fmt based logger with optionally color prints - which relies on ANSI color commands.
Unfortunately on Windows 10 it is disabled by default. I know how to enable it but I still want to find ou...
Dustin asked 16/9, 2020 at 4:11
1
Solved
I am aware that the c++20 format proposal is a formalization of parts of libfmt, and that libfmt is a compliant implementation of that formalization. However, it's my understanding that libfmt prov...
1
Solved
I have seen how useful std::format can be. But every time I try to include it on C++20 it does not work. it is apparently already included in its libraries but it does not appear, and there is no i...
1
Solved
I want to use the <format> header available in C++20.
I am using the most up-to-date release of CMake.
My CMakeFiles looks like
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
...
6
Solved
I am looking for a quick and neat way to print in a nice table format with cells being aligned properly.
Is there a convenient way in c++ to create strings of substrings with certain length like p...
Geotropism asked 30/6, 2017 at 4:53
2
Solved
In C++20 - how do you make a user-defined type compatible with std::format?
For example, let's say I have a type called Point:
struct Point {
int x;
int y;
};
with its operator<< define...
1
I've downloaded, built and added to the project the {fmt} 6.2.1 library on c++. I'm using Windows.
Problem is, the headers are recognized(Code:Blocks give me the auto-completion for them) but any ...
1
Solved
How to remove [] from the output?
#include <iostream>
#include <vector>
#include <fmt/format.h>
#include <fmt/ranges.h>
int main () {
std::vector<int> v = {1,2,3};
...
2
Solved
C++20 introduces std::format. What are the advantages over printf or std::cout?
How can I use it and someone give an example of it?
Doublebank asked 25/11, 2019 at 2:14
2
Solved
Can I print an object of the C++ class using fmt library?
fmt::print("The object is {}.", obj);
2
Solved
I have a custom type, for example
struct custom_type
{
double value;
};
I want to set a custom FMT formatter for this type. I do the following and it works:
namespace fmt
{
template <>
...
1
Solved
I've got my own logging functions. I want to use libfmt to format the log parameters, eg:
log_error("Error on read: {}", errMsg);
However compile time format string checking seems to only work i...
1
Solved
I want to have fmt::format return a wstring from EA's STL, but when I try to modify this code from the docs—which works fine:
// Prints formatted error message.
void
vreport_error(const char *form...
1
Solved
I want to use the fmt library to format floating point numbers.
I try to format a floating point number with decimal separator ',' and tried this without success:
#include <iostream>
#inclu...
1
Solved
I'm taking up some folks advice and looking into the fmt library:
http://fmtlib.net
It appears to have the features I need, and claims to support %p (pointer), but when compiling my code which use...
Toluate asked 10/5, 2019 at 0:3
© 2022 - 2024 — McMap. All rights reserved.