Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Single-header libraries from the Magnum engine

License

NotificationsYou must be signed in to change notification settings

mosra/magnum-singles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains single-header libraries from the Magnum engine.

Join the chat at https://gitter.im/mosra/magnumBuild StatusMIT License

LIBRARIES

There are the following single-header libraries at the moment. This list willgrow with more Magnum features being exposed this way.

LibraryLoCPpLoC[1]Description
CorradeArrayView.h9232013Containers::ArrayView andContainers::StaticArrayView, lightweight alternatives tostd::span
CorradeStridedArrayView.h1359[2]2876Containers::StridedArrayView, multi-dimensional strided array view. Depends onCorradeArrayView.h.
CorradeArray.h1067[2]2715Containers::Array andContainers::StaticArray, lightweight alternatives tostd::vector andstd::array. Depends onCorradeArrayView.h.
CorradeGrowableArray.h1126[2]4334Growable APIs forContainers::Array. Depends onCorradeArray.h.
CorradeEnumSet.h2651688Containers::EnumSet, a type-safe set of bits
CorradeFunction.h5051907Containers::Function, a lightweight alternative tostd::function
CorradeOptional.h4581863Containers::Optional, a lightweight alternative tostd::optional
CorradePair.h4321729Containers::Pair, a lightweight alternative tostd::pair
CorradePointer.h3811769Containers::Pointer, a lightweight alternative tostd::unique_ptr
CorradeReference.h1311613Containers::Reference, a lightweight alternative tostd::reference_wrapper
CorradeScopeGuard.h2631689Containers::ScopeGuard, a lightweight alternative tostd::unique_ptr with a custom deleter
CorradeString.hpp2521[2]2179Containers::String andContainers::StringView, lightweight and optimized string (view) classes. Depends onCorradeEnumSet.h, the implementation depends onCorradeCpu.hpp.
CorradeTriple.h4761746Containers::Triple, a lightweight alternative to a three-componentstd::tuple
CorradeCpu.hpp17301978Cpu library, compile-time and runtime CPU feature detection and dispatch
CorradeStlForwardArray.h8899[3]Corrade's forward declaration forstd::array, a lightweight alternative to the full<array> (15k PpLOC[1]) where supported
CorradeStlForwardString.h8992Corrade's forward declaration forstd::string, a lightweight alternative to the full<string> (11k PpLOC[1]) where supported
CorradeStlForwardTuple.h1022231Corrade's forward declaration forstd::tuple, a lightweight alternative to the full<tuple> (13k PpLOC[1]) where supported
CorradeStlForwardVector.h81181[3]Corrade's forward declaration forstd::vector, a lightweight alternative to the full<vector> (9k PpLOC[1]) where supported
CorradeStlMath.h733301[4]Corrade's optimized<cmath>, without the heavy C++17 additions (which is otherwise 11k PpLOC[4])
MagnumMath.hpp8388[2]9812Math namespace, a full-featured graphics-oriented linear algebra library. Depends onCorradePair.h.
MagnumMathBatch.hpp1318[2]11185Math namespace, batch APIs. The implementation depends onCorradeStridedArrayView.h andMagnumMath.hpp.
MagnumMeshTools.hpp765[2]283MeshTools namespace, algorithms for dealing with mesh data. Depends onCorradeStridedArrayView.h, the implementation depends onCorradeArray.h andMagnumMathBatch.hpp.

[1] — lines of code after a preprocessor run, with system includesexpanded. Gathered using GCC 14.2 and libstdc++, unless said otherwise.

[2] — not a total size due to inter-library dependencies

[3] — gathered using Clang 18.1 and libc++, since libstdc++ doesn'thave a forward declaration forstd::array /std::vector

[4] — gathered using GCC 14.2, libstdc++ and-std=c++17

Where is the documentation?

Single-header libraries provided here aregenerated from multi-file sourcesin the Magnum project. This is done for two reasons — first, documentation andtest coverage is much easier to maintain in the setting of a bigger project,avoiding any redundancy or duplicated efforts. Second, because the resultingfiles are generated with non-essential parts stripped away, there's no need toworry about bloating them due to original implementations having extensivedocumentation or rarely used features.

With the goal being easy integration, the files are deliberately free of allcomments and documentation blocks to keep their size small. Documentation foreach library is provided in the official Magnum documentation, linked from thetable above. Each library file contains the same documentation link, togetherwith a concrete Git revision it was generated from and a changelog for a fewversions back for easier overview when updating.

For more information read thesingle-header library docs. The libraries are generatedusingacme.py, which is a part of Corrade.See its documentation, if youare interested. Particular libraries are introduced on the Magnum blog:

What about test coverage?

Testing done in this repository is mainly to ensure the libraries are generatedcorrectly. Extensive testing on variety of compilers and OSes with > 99% testcoverage is done in the Magnum Project itself. See theBuild Status page for moreinformation.

Reporting bugs and contributing

As always, bug reports, feature requests and code contributions are verywelcome. However again please note the files in this repository are generatedfrom original sources in thecorrade andmagnum repositories, meaning that ideallyall PRs should go there instead, as there's a better infrastructure fordocumentation and testing. We don't enforce this rule though — if you have animportant bugfix, it's better if you submit it here than not at all 😉

SUPPORTED PLATFORMS

All libraries are tested on these platforms:

And on these compilers:

  • GCC 4.8.1 and newer (and equivalent MinGW-w64 version)
  • Clang 6.0 and newer (or AppleClang 10.0 and newer), bothlibstdc++andlibc++
  • MSVC 2015 and newer

CONTACT & SUPPORT

See also the Magnum ProjectContact & Support pagefor further information.

Credits

Libraries presented here are a result of a dedicated work by many communitymembers. List of all contributors to the Magnum Project can be foundin the documentation.

License

Magnum is licensed under the MIT/Expat license, see theCOPYING filefor details.


[8]ページ先頭

©2009-2025 Movatter.jp