Skip to content

Commit ac3f7e7

Browse files
committed
.
1 parent 894bcb2 commit ac3f7e7

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/json_to_cpp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ namespace daw::json_to_cpp {
9494
}
9595
// Look for characters that are not in the basic standard 5.10
9696
// non-digit or digit and escape them
97-
std::string new_name{};
97+
auto new_name = std::string( );
9898
daw::algorithm::transform_it(
9999
name.begin( ), name.end( ), std::back_inserter( new_name ),
100100
[]( char c, auto it ) {
@@ -133,7 +133,7 @@ namespace daw::json_to_cpp {
133133
return;
134134
}
135135

136-
std::vector<std::pair<std::string, types::ti_value>> diff{};
136+
auto diff = std::vector<std::pair<std::string, types::ti_value>>( );
137137
for( auto &orig_child : pos->children ) {
138138
auto child_pos = std::find_if(
139139
obj.children.begin( ), obj.children.end( ),
@@ -161,7 +161,7 @@ namespace daw::json_to_cpp {
161161
types::ti_value merge_array_values( types::ti_value const &a,
162162
types::ti_value const &b ) {
163163
using daw::json::json_value_t;
164-
types::ti_value result{};
164+
auto result = types::ti_value( );
165165
if( a.is_null( ) ) {
166166
result = b;
167167
result.is_optional( ) = true;
@@ -336,7 +336,7 @@ namespace daw::json_to_cpp {
336336
void generate_json_link_maps( bool definition, config_t &config,
337337
types::ti_object const &cur_obj ) {
338338

339-
return generate_json_link_maps( std::integral_constant<int, 3>{},
339+
return generate_json_link_maps( std::integral_constant<int, 3>( ),
340340
definition, config, cur_obj );
341341
}
342342

@@ -431,7 +431,7 @@ namespace daw::json_to_cpp {
431431
}
432432

433433
void generate_cpp( daw::string_view json_string, config_t &config ) {
434-
state_t obj_state{};
434+
auto obj_state = state_t( );
435435
auto json_obj = ::daw::json::parse_json( json_string );
436436
auto obj_info = parse_json_object( json_obj, obj_state, config );
437437
generate_code( obj_info, config, obj_state );

src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int main( int argc, char **argv ) {
6666
default_user_agent ),
6767
"User agent to use when downloading via URL" );
6868

69-
auto vm = boost::program_options::variables_map{};
69+
auto vm = boost::program_options::variables_map( );
7070
try {
7171
boost::program_options::store(
7272
boost::program_options::parse_command_line( argc, argv, desc ), vm );
@@ -80,7 +80,7 @@ int main( int argc, char **argv ) {
8080
std::cerr << desc << std::endl;
8181
return EXIT_FAILURE;
8282
}
83-
auto config = daw::json_to_cpp::config_t{};
83+
auto config = daw::json_to_cpp::config_t( );
8484

8585
if( !vm.count( "in_file" ) ) {
8686
std::cerr << "Missing in_file parameter\n";
@@ -116,8 +116,8 @@ int main( int argc, char **argv ) {
116116
exit( EXIT_FAILURE );
117117
}
118118
auto tmp = std::string( );
119-
std::copy( std::istream_iterator<char> {in_file},
120-
std::istream_iterator<char> {}, std::back_inserter( tmp ));
119+
std::copy( std::istream_iterator<char>( in_file ),
120+
std::istream_iterator<char>( ), std::back_inserter( tmp ));
121121
return tmp;
122122
}
123123
}( );
@@ -127,8 +127,8 @@ int main( int argc, char **argv ) {
127127
config.enable_jsonlink = vm["use_jsonlink"].as<bool>( );
128128
config.hide_null_only = vm["hide_null_only"].as<bool>( );
129129
config.use_string_view = vm["use_string_view"].as<bool>( );
130-
auto cpp_file = std::ofstream{};
131-
auto header_file = std::ofstream{};
130+
auto cpp_file = std::ofstream( );
131+
auto header_file = std::ofstream( );
132132

133133
if( vm.count( "cpp_file" ) > 0 ) {
134134
bool const allow_overwrite = vm["allow_overwrite"].as<bool>( );

0 commit comments

Comments
 (0)