I have a working R package including the necessary R/Cpp working. My question here is more of a 'good practices' when using nested namespace.
Currently, my package has; 1) cost functions, 2) optimization functions, 3) parallel workers that call the optimization functions. At present the workers are defined in the .cpp files that contain the exported (to R) cpp function. The optimization functions have one namespace and header file and the cost functions have they're own header/namespace file. All the optimization functions call a cost function so they include the 'cost function' header and use the 'cost function' namespace.
As the .cpp files that run in parallel and call the workers are on the order of ~700 lines, I was thinking to move the workers to a separate namespace and header file. These include the 'optimization' header and use the 'optimization' namespace.
That got me thinking, do I really need 3 nested namespaces? It would be nice not to have 3 namespaces with 2-4 functions in each of them. Additionally, the functions are/would always be called in order parallel_worker/optimize_function/cost_function, each living in a different namespace/header.