adamdebreceni commented on a change in pull request #839:
URL: https://github.com/apache/nifi-minifi-cpp/pull/839#discussion_r492112318



##########
File path: libminifi/include/utils/FlatMap.h
##########
@@ -0,0 +1,211 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef LIBMINIFI_INCLUDE_UTILS_FLATMAP_H_
+#define LIBMINIFI_INCLUDE_UTILS_FLATMAP_H_
+
+#include <tuple>
+#include <functional>
+#include <vector>
+#include <utility>
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace utils {
+
+template<typename K, typename V>
+class FlatMap{
+ public:
+  using value_type = std::pair<K, V>;

Review comment:
       I had no intention of making `FlatMap` adhere to any of the named 
requirements (that is why it does not), it seems like `AssociativeContainer` 
expects an ordering, should we go for `Container`?
   
   (frankly I ~~despise~~ dislike named requirements as they just further push 
the responsibilities to the programmer, which IMO should belong to the 
compiler, e.g. `Container` expects a `_.cbegin()` with constant complexity, so 
what happens if it is not, surely then the compiler rejects the program if we 
use the type where a `Container` is expected... in our dreams, mind you this is 
not unique to C++)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to