seldon-code / seldon

A code for opinion dynamics simulations.
GNU General Public License v3.0
6 stars 2 forks source link

Local Unused TypeDef warning #46

Closed User-DK closed 4 months ago

User-DK commented 4 months ago

https://github.com/seldon-code/seldon/blob/16a8d329448392ce3d9ecf71608f86cefb622585/include/util/math.hpp#L27-L31

The above local typedefs (using declarations) are raising warning as the compiler flag is turned on

specifically this are the warnings: warning: typedef ‘using reference = size_t&’ locally defined but not used [-Wunused-local-typedefs] ../subprojects/seldon/include/util/math.hpp: In function ‘void Seldon::draw_unique_k_from_n(std::optional, std::size_t, std::size_t, std::vector&, std::mt19937&)’: ../subprojects/seldon/include/util/math.hpp:27:15: warning: typedef ‘using iterator_category = struct std::forward_iterator_tag’ locally defined but not used [-Wunused-local-typedefs] 27 | using iterator_category = std::forward_iterator_tag; | ^~~~~ ../subprojects/seldon/include/util/math.hpp:28:15: warning: typedef ‘using difference_type = std::ptrdiff_t’ locally defined but not used [-Wunused-local-typedefs] 28 | using difference_type = std::ptrdiff_t; | ^~~~~~~ ../subprojects/seldon/include/util/math.hpp:29:15: warning: typedef ‘using value_type = size_t’ locally defined but not used [-Wunused-local-typedefs] 29 | using value_type = size_t; | ^~~~~~ ../subprojects/seldon/include/util/math.hpp:30:15: warning: typedef ‘using pointer = size_t’ locally defined but not used [-Wunused-local-typedefs] 30 | using pointer = size_t ; // or also value_type* | ^~~ ../subprojects/seldon/include/util/math.hpp:31:15: warning: typedef ‘using reference = size_t&’ locally defined but not used [-Wunused-local-typedefs] 31 | using reference = size_t &; | ^~~~~ ../subprojects/seldon/include/network_generation.hpp: In function ‘Seldon::Network Seldon::NetworkGeneration::generate_square_lattice(size_t, typename Seldon::Network::WeightT)’: ../subprojects/seldon/include/network_generation.hpp:246:11: warning: typedef ‘using WeightT = typename NetworkT::WeightT’ locally defined but not used [-Wunused-local-typedefs] 246 | using WeightT = typename NetworkT::WeightT; | ^~~

I think one solution can be commenting out the unused using declarations to avoid these warnings if ok then I would make a PR