New answers tagged

2

Consider using enum class Instead of having a regular enum inside its own namespace, use an enum class: enum class UsartSpace: u32 { usart0 = XPAR_PS7_UART_0_BASEADDR, usart1 = XPAR_PS7_UART_1_BASEADDR, }; Then, to ensure someone cannot instantiate a Usart with the wrong base address, make the constructor take this enum as a parameter: template &...


2

Avoid using too much namespace You risk having identical names mapped onto each other. Either be more selective in what you are using, or create short aliases if you want to avoid typing long namespace names, like: namespace fs = ghc::filesystem; You already ran into this problem with is_empty(). Don't #include headers you don't need In wrap.h, you #...


Top 50 recent answers are included