Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
make (3 coordinate values)

Construct a geometry.

Synopsis

template<typename Geometry, typename Type, std::enable_if_t<! traits::make< Geometry >::is_specialized, int >>
Geometry make(Type const & c1, Type const & c2, Type const & c3)

Parameters

Type

Concept

Name

Description

Geometry

Any type fulfilling a Geometry Concept

-

Must be specified

std::enable_if_t<! traits::make< Geometry >::is_specialized, int >

-

Must be specified

Type const &

numerical type (int, double, ttmath, ...) to specify the coordinates

c1

First coordinate (usually x-coordinate)

Type const &

numerical type (int, double, ttmath, ...) to specify the coordinates

c2

Second coordinate (usually y-coordinate)

Type const &

numerical type (int, double, ttmath, ...) to specify the coordinates

c3

Third coordinate (usually z-coordinate)

Returns

The constructed geometry, here: a 3D point

Header

Either

#include <boost/geometry.hpp>

Or

#include <boost/geometry/algorithms/make.hpp>

Example

Using make to construct a three dimensional point

#include <iostream>

#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>

int main()
{
    typedef boost::geometry::model::point<double, 3, boost::geometry::cs::cartesian> point_type;
    point_type p = boost::geometry::make<point_type>(1, 2, 3);
    std::cout << boost::geometry::dsv(p) << std::endl;
    return 0;
}

Output:

(1, 2, 3)
See also

PrevUpHomeNext