Skip to content

Latest commit

 

History

156 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protocol: Structural Subtyping for C++

Language Standard License

We propose the addition of two class templates, protocol<T, A> and protocol_view<T>, to the C++ Standard Library. Both classes support structural-subtyping, protocol is owning, protocol_view is non-owning.

See DRAFT.md for more details on design.

This repository contains both the ISO C++ proposal to add these new library types and a reference implementation, protocol.hh, built on C++26 reflection (P2996). It requires a compiler with reflection support, such as a GCC trunk snapshot with -freflection.

Standardization

The paper P4148R2 (derived from DRAFT.md) was presented to the C++ Standard Library Incubator working group in Brno on June 11th 2026. The authors have been encouraged to continue work.

Contributing and Development

For build instructions, testing and contributing guidelines, see CONTRIBUTING.md.

GitHub codespaces

Press . or visit [https://github.dev/jbcoe/cc-protocol] to open the project in an instant, cloud-based, development environment. We have defined a devcontainer that will automatically install the dependencies required to build and test the project.

About

A type erased value-type for C++ using reflection

Resources

Contributing

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from jbcoe/value_types