<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Can you write expressive code? &#8211; Christmas break challenge	</title>
	<atom:link href="https://www.fluentcpp.com/2016/12/19/can-you-write-expressive-code-christmas-break-challenge/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2016/12/19/can-you-write-expressive-code-christmas-break-challenge/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Sun, 05 Feb 2017 07:05:29 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.4</generator>
	<item>
		<title>
		By: FredTingaud		</title>
		<link>https://www.fluentcpp.com/2016/12/19/can-you-write-expressive-code-christmas-break-challenge/#comment-18</link>

		<dc:creator><![CDATA[FredTingaud]]></dc:creator>
		<pubDate>Tue, 20 Dec 2016 16:51:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=246#comment-18</guid>

					<description><![CDATA[And a ranges::v3 solution:
&lt;pre&gt;&lt;code&gt;
#include 
#include 
using namespace ranges::v3;

static const double MaxDistance = 100;

bool nearCity(const City&#038; city1, const City&#038; city2)
{
  return city1.getGeographicalAttributes().getLocation().distanceTo(city2.getGeographicalAttributes().getLocation()) &#060; MaxDistance;
}
int computeNumberOfBreaksV3(const std::vector&#038; route)
{
  return distance(route &#124; view::adjacent_remove_if(nearCity)) - 1;
}
&lt;/code&gt;&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>And a ranges::v3 solution:</p>
<pre><code>
#include 
#include 
using namespace ranges::v3;

static const double MaxDistance = 100;

bool nearCity(const City&amp; city1, const City&amp; city2)
{
  return city1.getGeographicalAttributes().getLocation().distanceTo(city2.getGeographicalAttributes().getLocation()) &lt; MaxDistance;
}
int computeNumberOfBreaksV3(const std::vector&amp; route)
{
  return distance(route | view::adjacent_remove_if(nearCity)) - 1;
}
</code></pre>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
