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

fix: Made range arrayFormat overload more elegant + minor fixes #837

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

eric-bodhi
Copy link
Contributor

Running on latest GCC version and ubuntu 22.04 I was getting conversion warnings from arrayFormat(start, end) overload specifically when used with sortedSizeArrayElement in word_test.cpp

Primary Warnings thrown:
In instantiation of function template specialization 'faker::word::sortedSizeArrayElement<__gnu_cxx::__normal_iterator<std::basic_string *, std::vector<std::basic_string>>>' /home/eric/github/faker-cxx/include/faker-cxx/helper.h:64:18: warning: implicit conversion changes signedness: 'unsigned long const' to '__gnu_cxx::__normal_iterator<std::basic_string *, std::vector<std::basic_string>>::difference_type' (aka 'long')

Fixed arrayFormat to enforce input_iterator concept in templates and fixed implicit conversion in index return of the function.
Cleaned up boolean(probability) of datatype.cpp

  • Originally checked ifnan through if (probability != nan("")) now uses std::isnan function

@eric-bodhi eric-bodhi changed the title Fix: Made range arrayFormat overload more elegant + minor fixes fix: Made range arrayFormat overload more elegant + minor fixes Jul 31, 2024
@cieslarmichal cieslarmichal merged commit 9c52cb4 into cieslarmichal:main Jul 31, 2024
15 of 16 checks passed
@eric-bodhi eric-bodhi deleted the bugfix branch August 1, 2024 17:07
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