[boost::geometry] побороть варнинг
От: IROV..  
Дата: 06.09.11 18:03
Оценка: :)
вызываю код

namespace boost 
{
    namespace geometry
    {
        namespace traits
        {
            template <>
            struct tag<mt::vec2f>
            {
                typedef boost::geometry::point_tag type;
            };

            template<>
            struct coordinate_type<mt::vec2f>
            {
                typedef float type;
            };

            template<>
            struct coordinate_system<mt::vec2f>
            {
                typedef boost::geometry::cs::cartesian type;
            };

            template<>
            struct dimension<mt::vec2f>
                : boost::mpl::int_<2>
            {};

            template<std::size_t Dimension>
            struct access<mt::vec2f, Dimension >
            {
                static inline float get(mt::vec2f const& p)
                {
                    return p.template get<Dimension>();
                }

                static inline void set(mt::vec2f & p, float const& value)
                {
                    p.template set<Dimension>(value);
                }
            };

        } // namespace traits
    }
}

Polygon point_polygon;
typedef boost::geometry::model::polygon<mt::vec2f> Polygon;

boost::geometry::correct(point_polygon);


в дебрях вылазиет,

        Predicate predicate;
        coordinate_type const zero = 0;
        if (predicate(ring_area_type::apply(r, strategy_type()), zero)) //вот здеся!


вот такой варнинг.

2>D:\Projects\boost_1_47_0\boost/geometry/algorithms/correct.hpp(151): warning C4244: 'argument' : conversion from 'double' to 'const float', possible loss of data
2> D:\Projects\boost_1_47_0\boost/geometry/algorithms/correct.hpp(130) : while compiling class template member function 'void boost::geometry::detail::correct::correct_ring<Ring,Predicate>::apply(Ring &)'
2> with
2> [
2> Ring=boost::geometry::model::ring<mt::vec2f,true,true,std::vector,std::allocator>,
2> Predicate=std::less<float>
2> ]
2> D:\Projects\boost_1_47_0\boost/geometry/algorithms/correct.hpp(172) : see reference to class template instantiation 'boost::geometry::detail::correct::correct_ring<Ring,Predicate>' being compiled
2> with
2> [
2> Ring=boost::geometry::model::ring<mt::vec2f,true,true,std::vector,std::allocator>,
2> Predicate=std::less<float>
2> ]
2> D:\Projects\boost_1_47_0\boost/geometry/algorithms/correct.hpp(167) : while compiling class template member function 'void boost::geometry::detail::correct::correct_polygon<Polygon>::apply(Polygon &)'
2> with
2> [
2> Polygon=Menge::Polygon
2> ]
2> D:\Projects\boost_1_47_0\boost/geometry/algorithms/correct.hpp(239) : see reference to class template instantiation 'boost::geometry::detail::correct::correct_polygon<Polygon>' being compiled
2> with
2> [
2> Polygon=Menge::Polygon
2> ]
2> D:\Projects\boost_1_47_0\boost/geometry/algorithms/correct.hpp(263) : see reference to class template instantiation 'boost::geometry::dispatch::correct<Tag,Geometry>' being compiled
2> with
2> [
2> Tag=boost::geometry::polygon_tag,
2> Geometry=Menge::Polygon
2> ]
2> d:\Projects\Mengine\src\Menge\HelperScriptWrapper.cpp(195) : see reference to function template instantiation 'void boost::geometry::correct<Menge::Polygon>(Geometry &)' being compiled
2> with
2> [
2> Geometry=Menge::Polygon
2> ]


Весь лог испоганил ) есть способ бороть?
я не волшебник, я только учусь!
Re: [boost::geometry] побороть варнинг
От: sysenter  
Дата: 06.09.11 18:13
Оценка:
Здравствуйте, IROV.., Вы писали:

IRO>
IRO>Polygon point_polygon;
IRO>typedef boost::geometry::model::polygon<mt::vec2f> Polygon;

IRO>boost::geometry::correct(point_polygon);
IRO>


Если местами поменять строки 1 и 2 вылазит?

IRO>
IRO>typedef boost::geometry::model::polygon<mt::vec2f> Polygon;
IRO>Polygon point_polygon;

IRO>boost::geometry::correct(point_polygon);
IRO>
Re[2]: [boost::geometry] побороть варнинг
От: IROV..  
Дата: 06.09.11 23:41
Оценка:
Здравствуйте, sysenter, Вы писали:

S>Здравствуйте, IROV.., Вы писали:


IRO>>
IRO>>Polygon point_polygon;
IRO>>typedef boost::geometry::model::polygon<mt::vec2f> Polygon;

IRO>>boost::geometry::correct(point_polygon);
IRO>>


S>Если местами поменять строки 1 и 2 вылазит?


IRO>>
IRO>>typedef boost::geometry::model::polygon<mt::vec2f> Polygon;
IRO>>Polygon point_polygon;

IRO>>boost::geometry::correct(point_polygon);
IRO>>


Я думаю это просто я опечатался когда составлял вопрос
второй вариант — так и есть
я не волшебник, я только учусь!
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.