Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize core functions on the type of the format string. #885

Closed
wants to merge 1 commit into from

Conversation

DanielaE
Copy link
Contributor

Take #1 of n

Signed-off-by: Daniela Engert dani@ngrt.de

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Mostly looks good, just two small comments.

}

template <typename Container, typename... Args>
#define FMT_CHAR(Str) typename internal::format_string_traits<Str>::char_type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a blank line to separate the macro from the function definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've moved it up just below the traits block.

BTW: this FMT_CHAR(Str) macro really bothers me. What about replacing it with a type alias like so:

template <typename S>
using char_t = typename format_string_traits<S>::char_type;

Is there a reason not to use type aliases (like ancient gcc or so)? Even msvc from Visual Studio 2013 compiles them just fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The macro is there to support gcc versions older than 4.7, e.g. gcc 4.6.4 released in 2013. I don't like it either and eventually it will be replace with the type alias you wrote or similar.

It looks like FMT_CHAR is defined twice now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, too much git history editing without coffee. Fixed now.

/**
Prints formatted data to the file *f* which should be in wide-oriented mode

**Hint**::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think :: is correct here. It's probably better to just have a normal sentence:

Prints formatted data to the file *f*. For wide format strings, *f* should be in wide-oriented mode ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if you say so 😄 I have no clue about rst and just copied the syntax from three lines above. Thanks for the correction and the improved wording.

Take #1 of n

Signed-off-by: Daniela Engert <dani@ngrt.de>
@vitaut
Copy link
Contributor

vitaut commented Sep 30, 2018

Merged in 267fdc7. Thanks!

@vitaut vitaut closed this Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants