Skip to content

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Sep 20, 2024
1 parent 65063e8 commit b58b6bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/xtd.core/include/xtd/internal/__iformatable_formatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ std::string __to_string_istringable_to_string(const xtd::istringable* obj);

template<typename value_t>
static std::string __to_string_polymorphic(const value_t& value, const std::string& fmt, const std::locale& loc, std::true_type) {
if (dynamic_cast<const std::exception*>(&value)) return std::string {"exception: "} + dynamic_cast<const std::exception&>(value).what();
if (dynamic_cast<const xtd::iformatable*>(&value)) return dynamic_cast<const xtd::iformatable&>(value).__opague_internal_formatable__(reinterpret_cast<intptr_t>(&fmt), reinterpret_cast<intptr_t>(&loc), 0, INTPTR_MAX);
if (dynamic_cast<const xtd::istringable*>(&value)) return __to_string_istringable_to_string(dynamic_cast<const xtd::istringable*>(&value));
if (dynamic_cast<const xtd::object*>(&value)) return __to_string_object_to_string(dynamic_cast<const xtd::object*>(&value));
auto value_ptr = &value;
if (dynamic_cast<const std::exception*>(value_ptr)) return std::string {"exception: "} + dynamic_cast<const std::exception&>(value).what();
if (dynamic_cast<const xtd::iformatable*>(value_ptr)) return dynamic_cast<const xtd::iformatable&>(value).__opague_internal_formatable__(reinterpret_cast<intptr_t>(&fmt), reinterpret_cast<intptr_t>(&loc), 0, INTPTR_MAX);
if (dynamic_cast<const xtd::istringable*>(value_ptr)) return __to_string_istringable_to_string(dynamic_cast<const xtd::istringable*>(&value));
if (dynamic_cast<const xtd::object*>(value_ptr)) return __to_string_object_to_string(dynamic_cast<const xtd::object*>(value_ptr));
__format_exception(typeid(value)); return {};
}

Expand Down

0 comments on commit b58b6bc

Please sign in to comment.