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

Support long & long double, add macro INSTANTIATE_FOR_NUMERIC_TYPES (Fix #319) #397

Merged
merged 6 commits into from
Sep 11, 2022

Commits on Sep 7, 2022

  1. implot_items: INSTANTIATE_FOR_NUMERIC_TYPES / add long & long double (F…

    …ix epezent#319)
    
    - INSTANTIATE_FOR_NUMERIC_TYPES is a macro which instantiates templated plotting functions for numeric types.
    This macro helps reduce some boilerplate code for template functions instantiations.
    
    - Added optional support for more numeric types (long and long double)
    The numeric type list does not include "long", "unsigned long" and "long double".
    Most of the time, it is not an issue when linking statically.
    However, when linking dynamically, issues related to undefined functions can arise:
    although those types might have the same size, they are considered separate.
    
    define IMPLOT_INSTANTIATE_ALL_NUMERIC_TYPES) in order to define versions for those types
    
    In this case, the compilation time for this specific file will be 33% longer
    
    - implot_internal.h / ImMean and ImStdDev: added cast  to double
    (suppress MSVC warning about downcasting)
    
    - Notes about numeric types "synonyms":
      Even if "long double" and "double" might occupy the same size,
    they are not complete synonyms, and it is legal to define overloads for both double and long double.
      On some platforms, "unsigned long" might be the same size as "unsigned long long",
    but it is nonetheless a separate type: see https://godbolt.org/z/1KWv5re7q (example with GCC 64 bits)
      On some other platforms, "long double" might be the same size as "double", but it is nonetheless a separate type: see https://godbolt.org/z/ae71P7rqG (example with MSVC 64 bits)
    pthom committed Sep 7, 2022
    Configuration menu
    Copy the full SHA
    df1a5a2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    47409a4 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2022

  1. Configuration menu
    Copy the full SHA
    3e19356 View commit details
    Browse the repository at this point in the history

Commits on Sep 11, 2022

  1. Configuration menu
    Copy the full SHA
    b6c973e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    808e5c7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    17adf77 View commit details
    Browse the repository at this point in the history