Make every header self-contained - #102
Open
susilehtola wants to merge 1 commit into
Open
Conversation
None of the library headers could be relied upon to compile on their own; they worked only when something else had already pulled in the standard headers they use. Compiling each non-data header in isolation produced eight hard failures: * spherical_micro_batcher.hpp calls std::any_of, std::minmax_element, std::partition, std::sort, std::unique and std::set_union without <algorithm>. * product_quadrature.hpp declares std::unique_ptr members without <memory>, so the class had no members at all when compiled alone. This cascaded into spherical_quadrature.hpp, pruned_spherical_quadrature.hpp and the batcher. * util/create_array.hpp uses std::array and std::index_sequence, util/copy_grid.hpp uses std::copy, util/legendre.hpp uses size_t, and util/bound_transform.hpp uses assert and std::tuple, none of them declared. Separately, <cmath> was not included anywhere in the library, although std::cos, std::sin, std::sqrt, std::pow, std::log and std::abs are used throughout and M_PI appears in nine places. The two Newton solvers also use std::numeric_limits and std::runtime_error without <limits> or <stdexcept>. Add the includes each header actually needs. Also qualify the one unqualified cos() call in gausslobatto.hpp: <cmath> is not required to place names in the global namespace, so it only resolved because <math.h> happened to be reachable. Every non-data header now compiles standalone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FDTFYJMQ76iujDFNHzZyXF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
None of the library headers could be relied upon to compile on their own;
they worked only when something else had already pulled in the standard
headers they use. Compiling each non-data header in isolation produced
eight hard failures:
std::partition, std::sort, std::unique and std::set_union without
.
, so the class had no members at all when compiled alone. This
cascaded into spherical_quadrature.hpp, pruned_spherical_quadrature.hpp
and the batcher.
util/copy_grid.hpp uses std::copy, util/legendre.hpp uses size_t, and
util/bound_transform.hpp uses assert and std::tuple, none of them
declared.
Separately, was not included anywhere in the library, although
std::cos, std::sin, std::sqrt, std::pow, std::log and std::abs are used
throughout and M_PI appears in nine places. The two Newton solvers also
use std::numeric_limits and std::runtime_error without or
.
Add the includes each header actually needs. Also qualify the one
unqualified cos() call in gausslobatto.hpp: is not required to
place names in the global namespace, so it only resolved because <math.h>
happened to be reachable.
Every non-data header now compiles standalone.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FDTFYJMQ76iujDFNHzZyXF