RcppMagicEnum

Rcpp Bindings to Magic Enum

https://github.com/eddelbuettel/rcppmagicenum

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Rcpp Bindings to Magic Enum

Basic Info
  • Host: GitHub
  • Owner: eddelbuettel
  • License: other
  • Language: C++
  • Default Branch: master
  • Size: 43 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

RcppMagicEnum: Rcpp Bindings to Magic Enum Library

CI License CRAN Dependencies Last Commit

Motivation

Even Modern C++ does not have proper reflection (yet). The Magic Enum library by Daniil Goncharov fills this void for enum types, and does so in a header-only fashion that is eay to deploy (provided recent-enough compilers).

A compelling example is included in the package, more examples are at the Magic Enum repository.

Example

The following file can be passed to Rcpp::sourceCpp() as is:

```c++ // [[Rcpp::depends(RcppMagicEnum)]]

include

// define a simple enum class, it uses optional typing as well as optional assigned values enum class Color : int { RED = -10, BLUE = 0, GREEN = 10 };

// [[Rcpp::export]] void example() { // instantiate an enum value in variable 'val' auto val = Color::RED;

// show the current value on stdout
Rcpp::Rcout << "Name of enum: " << magic_enum::enum_name(val) << std::endl;
Rcpp::Rcout << "Integer value of enum: " << magic_enum::enum_integer(val) << std::endl;

}

/*** R example() */ ```

It produces the following output (where the 'meta-comment' at the end ensure the included and created-by-sourcing function example() is also called):

```r

Rcpp::sourceCpp("miniex.cpp")

example() Name of enum: RED Integer value of enum: -10

```

Status

The package is complete and contains a mature version of Magic Enum.

Installation

The package is available via CRAN and can be installed the usual way via install.packages("RcppMagicEnum").

Contributing

Any problems, bug reports, or features requests for the package can be submitted and handled most conveniently as Github issues in the repository.

Before submitting pull requests, it is frequently preferable to first discuss need and scope in such an issue ticket. See the file Contributing.md (in the Rcpp repo) for a brief discussion.

Authors

For the R package, Dirk Eddelbuettel.

For everything pertaining to Magic Enum: Daniil Goncharov.

Owner

  • Name: Dirk Eddelbuettel
  • Login: eddelbuettel
  • Kind: user
  • Location: Chicago, IL, USA

GitHub Events

Total
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 8
  • Total Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 8
  • Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Dirk Eddelbuettel e****d@d****g 8
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 173 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: RcppMagicEnum

'Rcpp' Bindings to 'Magic Enum' 'C++' 'Enum' Support

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 173 Last month
Rankings
Dependent packages count: 28.4%
Dependent repos count: 35.0%
Average: 50.1%
Downloads: 86.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/ci.yaml actions
  • actions/checkout v4 composite
  • eddelbuettel/github-actions/r-ci-setup master composite
DESCRIPTION cran
  • Rcpp >= 1.0.10 imports
  • tinytest * suggests