Skip to content

Fix compilation of README and ExternalProject examples - #336

Open
dajiaohuang wants to merge 1 commit into
Dobiasd:masterfrom
dajiaohuang:repostew/docs-consumer-examples-20261016
Open

dajiaohuang wants to merge 1 commit into
Dobiasd:masterfrom
dajiaohuang:repostew/docs-consumer-examples-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Summary

Fix three compilation errors in the documented consumer examples:

  • Use int main() in the README's cat example (GCC rejects void main()).
  • Pass the element type before the output container in numbers<int, Ints>(1, 30), matching the public numbers template signature. numbers<Ints> treats the list type as the numeric element type and does not compile.
  • Add /include to the ExternalProject example's include directory, so <fplus/fplus.hpp> can be found in the downloaded repository.

No library behavior or compiler requirements change.

Validation

Tested with GCC 13.3.0, -std=c++14, and CMake 3.28.3 on Ubuntu 24.04:

  • Reproduced both README compilation failures and the ExternalProject missing-header failure before these corrections.
  • Compiled the corrected README snippets; the cat and Collatz outputs exactly match the documented outputs. For Collatz, supplied the declared std::list<int> collatz_seq(int) implementation used in test/readme_examples_test.cpp.
  • Configured, built and ran the documented ExternalProject consumer including <fplus/fplus.hpp>.
  • Configured/built the library, installed to a local prefix, and built/ran a find_package(FunctionalPlus) consumer.
  • Built/ran the documented FetchContent consumer, reusing the local source checkout through CMake's source override.
  • Ran a small independent consumer against both modular and all-in-one headers: vector transform/filter/fold, strings, map creation, grouping, maybe/result propagation, forward pipelines, and the three Gemstones composition styles.
  • git diff --check passes.

The full upstream test suite and other compiler/platform/package-manager matrices were not run; this change only corrects documentation examples.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The three focused documentation fixes match the library API and header layout, with no unresolved issues.

0 open findings

What changed in this PR

Corrects three compilation errors in documented consumer examples without changing library behavior or compiler requirements.

Changes:

  • Fixes the README’s main return type and numbers template arguments.
  • Points the ExternalProject consumer at the repository’s include directory.
File Description
README.md Corrects the cat and Collatz examples.
INSTALL.md Fixes the ExternalProject include path.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants