result_t operator()(config& child, const std::string& key, int startindex, int endindex) const
	{
		assert(endindex - startindex >= 0);
		if(endindex > 0) {
			// NOTE: currently this is only called from as_range_visitor_base<vi_policy_create>
			// Based on that assumption we use vi_policy_create::get_child_at here instead of making this
            // a class template.
			vi_policy_create::get_child_at(child, key, endindex - 1);
		}

		int size_diff = datasource_.size() - (endindex - startindex);

		// remove configs first
		while(size_diff < 0) {
			child.remove_child(key, startindex);
			++size_diff;
		}

		std::size_t index = 0;
		for(index = 0; index < static_cast<std::size_t>(size_diff); ++index) {
			child.add_child_at(key, config(), startindex + index).swap(datasource_[index]);
		}

		for(; index < datasource_.size(); ++index) {
			child.child(key, startindex + index).swap(datasource_[index]);
		}

		return get_child_range(child, key, startindex, datasource_.size());
	}