Check for duplicate registration.

This commit is contained in:
2024-04-26 17:49:37 -04:00
parent ad80c08c64
commit 52b451d7f3
+4
View File
@@ -203,6 +203,10 @@ namespace Planets ::detail:: Generate_m
void
Generator::add( const std::string &name, std::unique_ptr< Generator > gen )
{
if( registry().count( name ) )
{
throw std::runtime_error( "Double registration of `" + name + "`" );
}
registry()[ name ]= std::move( gen );
}
}