Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
grisumbras committed Jun 15, 2023
1 parent 9d848ed commit 0e823dc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/boost/json/impl/object.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <new>
#include <stdexcept>
#include <type_traits>
#include <iostream>

namespace boost {
namespace json {
Expand Down Expand Up @@ -809,10 +810,14 @@ void
object::
destroy() noexcept
{
std::cerr << "0 destroy\n";
BOOST_ASSERT(t_->capacity > 0);
BOOST_ASSERT(! sp_.is_not_shared_and_deallocate_is_trivial());
std::cerr << "1 destroy\n";
destroy(begin(), end());
std::cerr << "2 destroy\n";
table::deallocate(t_, sp_);
std::cerr << "3 destroy\n";
}

void
Expand Down
3 changes: 3 additions & 0 deletions include/boost/json/impl/value.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <limits>
#include <new>
#include <utility>
#include <iostream>

namespace boost {
namespace json {
Expand Down Expand Up @@ -80,6 +81,7 @@ get_parse_options( std::istream& is )
value::
~value() noexcept
{
std::cerr << "0 ~value\n";
switch(kind())
{
case json::kind::null:
Expand All @@ -102,6 +104,7 @@ value::
obj_.~object();
break;
}
std::cerr << "1 ~value\n";
}

value::
Expand Down
15 changes: 14 additions & 1 deletion test/snippets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <numeric>
#include <string>
#include <vector>
#include <iostream>

#include "test_suite.hpp"
#include "doc_types.hpp"
Expand Down Expand Up @@ -220,10 +221,17 @@ tag_invoke(

for( const auto& item: m )
{
std::cerr << "0 maps_as_objects\n";
auto k = boost::json::value_from( item.first, ctx, jo.storage() );
std::cerr << "1 " << k << " maps_as_objects\n";
auto v = boost::json::value_from( item.second, ctx, jo.storage() );
jo[std::move( k.as_string() )] = std::move( v );
std::cerr << "2 " << v << " maps_as_objects\n";
auto it = jo.emplace( std::move( k.as_string() ), nullptr).first;
std::cerr << "3 maps_as_objects\n";
it->value() = std::move( v );
std::cerr << "4 maps_as_objects\n";
}
std::cerr << "5 maps_as_objects\n";
}

template<
Expand Down Expand Up @@ -1107,19 +1115,24 @@ usingContextualConversions()
{ start += std::chrono::minutes(14), {192, 168, 10, 10} },
};

std::cerr << "0\n";
value jv = value_from(
log,
std::make_tuple( maps_as_objects(), as_string(), as_iso_8601() ) );
std::cerr << "1\n";
assert( jv == parse(
" { "
" \"1970-01-01T00:00:10\": \"192.168.10.11\", "
" \"1970-01-01T02:00:10\": \"192.168.10.13\", "
" \"1970-01-01T02:14:10\": \"192.168.10.10\" "
" } "
) );
std::cerr << "2\n";
//]
(void)jv;
std::cerr << "3\n";
}
std::cerr << "4\n";
}

} // namespace
Expand Down

0 comments on commit 0e823dc

Please sign in to comment.