diff --git a/linux/include/abseil-cpp/.clang-format b/linux/include/abseil-cpp/.clang-format
new file mode 100644
index 000000000..06ea346a1
--- /dev/null
+++ b/linux/include/abseil-cpp/.clang-format
@@ -0,0 +1,4 @@
+---
+Language: Cpp
+BasedOnStyle: Google
+...
diff --git a/linux/include/abseil-cpp/.gitignore b/linux/include/abseil-cpp/.gitignore
new file mode 100644
index 000000000..31f337414
--- /dev/null
+++ b/linux/include/abseil-cpp/.gitignore
@@ -0,0 +1,15 @@
+# Ignore all bazel-* symlinks.
+/bazel-*
+# Ignore Bazel verbose explanations
+--verbose_explanations
+# Ignore CMake usual build directory
+build
+# Ignore Vim files
+*.swp
+# Ignore QtCreator Project file
+CMakeLists.txt.user
+# Ignore VS Code files
+.vscode/*
+# Ignore generated python artifacts
+copts/copts.pyc
+copts/__pycache__/
diff --git a/linux/include/abseil-cpp/ABSEIL_ISSUE_TEMPLATE.md b/linux/include/abseil-cpp/ABSEIL_ISSUE_TEMPLATE.md
new file mode 100644
index 000000000..ed5461f16
--- /dev/null
+++ b/linux/include/abseil-cpp/ABSEIL_ISSUE_TEMPLATE.md
@@ -0,0 +1,22 @@
+Please submit a new Abseil Issue using the template below:
+
+## [Short title of proposed API change(s)]
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+## Background
+
+[Provide the background information that is required in order to evaluate the
+proposed API changes. No controversial claims should be made here. If there are
+design constraints that need to be considered, they should be presented here
+**along with justification for those constraints**. Linking to other docs is
+good, but please keep the **pertinent information as self contained** as
+possible in this section.]
+
+## Proposed API Change (s)
+
+[Please clearly describe the API change(s) being proposed. If multiple changes,
+please keep them clearly distinguished. When possible, **use example code
+snippets to illustrate before-after API usages**. List pros-n-cons. Highlight
+the main questions that you want to be answered. Given the Abseil project compatibility requirements, describe why the API change is safe.]
diff --git a/linux/include/abseil-cpp/AUTHORS b/linux/include/abseil-cpp/AUTHORS
new file mode 100644
index 000000000..976d31def
--- /dev/null
+++ b/linux/include/abseil-cpp/AUTHORS
@@ -0,0 +1,6 @@
+# This is the list of Abseil authors for copyright purposes.
+#
+# This does not necessarily list everyone who has contributed code, since in
+# some cases, their employer may be the copyright holder. To see the full list
+# of contributors, see the revision history in source control.
+Google Inc.
diff --git a/linux/include/abseil-cpp/CMake/AbseilHelpers.cmake b/linux/include/abseil-cpp/CMake/AbseilHelpers.cmake
new file mode 100644
index 000000000..350282f7a
--- /dev/null
+++ b/linux/include/abseil-cpp/CMake/AbseilHelpers.cmake
@@ -0,0 +1,222 @@
+#
+# Copyright 2017 The Abseil Authors.
+#
+# Licensed 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.
+#
+
+include(CMakeParseArguments)
+include(AbseilConfigureCopts)
+
+# The IDE folder for Abseil that will be used if Abseil is included in a CMake
+# project that sets
+# set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+# For example, Visual Studio supports folders.
+set(ABSL_IDE_FOLDER Abseil)
+
+# absl_cc_library()
+#
+# CMake function to imitate Bazel's cc_library rule.
+#
+# Parameters:
+# NAME: name of target (see Note)
+# HDRS: List of public header files for the library
+# SRCS: List of source files for the library
+# DEPS: List of other libraries to be linked in to the binary targets
+# COPTS: List of private compile options
+# DEFINES: List of public defines
+# LINKOPTS: List of link options
+# PUBLIC: Add this so that this library will be exported under absl:: (see Note).
+# Also in IDE, target will appear in Abseil folder while non PUBLIC will be in Abseil/internal.
+# TESTONLY: When added, this target will only be built if user passes -DABSL_RUN_TESTS=ON to CMake.
+#
+# Note:
+# By default, absl_cc_library will always create a library named absl_internal_${NAME},
+# and alias target absl::${NAME}.
+# This is to reduce namespace pollution.
+#
+# absl_cc_library(
+# NAME
+# awesome
+# HDRS
+# "a.h"
+# SRCS
+# "a.cc"
+# )
+# absl_cc_library(
+# NAME
+# fantastic_lib
+# SRCS
+# "b.cc"
+# DEPS
+# absl_internal_awesome # not "awesome"!
+# )
+#
+# If PUBLIC is set, absl_cc_library will instead create a target named
+# absl_${NAME} and still an alias absl::${NAME}.
+#
+# absl_cc_library(
+# NAME
+# main_lib
+# ...
+# PUBLIC
+# )
+#
+# User can then use the library as absl::main_lib (although absl_main_lib is defined too).
+#
+# TODO: Implement "ALWAYSLINK"
+function(absl_cc_library)
+ cmake_parse_arguments(ABSL_CC_LIB
+ "DISABLE_INSTALL;PUBLIC;TESTONLY"
+ "NAME"
+ "HDRS;SRCS;COPTS;DEFINES;LINKOPTS;DEPS"
+ ${ARGN}
+ )
+
+ if (NOT ABSL_CC_LIB_TESTONLY OR ABSL_RUN_TESTS)
+ if (ABSL_CC_LIB_PUBLIC)
+ set(_NAME "absl_${ABSL_CC_LIB_NAME}")
+ else()
+ set(_NAME "absl_internal_${ABSL_CC_LIB_NAME}")
+ endif()
+
+ # Check if this is a header-only library
+ set(ABSL_CC_SRCS "${ABSL_CC_LIB_SRCS}")
+ list(FILTER ABSL_CC_SRCS EXCLUDE REGEX ".*\\.h")
+ if ("${ABSL_CC_SRCS}" STREQUAL "")
+ set(ABSL_CC_LIB_IS_INTERFACE 1)
+ else()
+ set(ABSL_CC_LIB_IS_INTERFACE 0)
+ endif()
+
+ if(NOT ABSL_CC_LIB_IS_INTERFACE)
+ add_library(${_NAME} STATIC "")
+ target_sources(${_NAME} PRIVATE ${ABSL_CC_LIB_SRCS} ${ABSL_CC_LIB_HDRS})
+ target_include_directories(${_NAME}
+ PUBLIC ${ABSL_COMMON_INCLUDE_DIRS})
+ target_compile_options(${_NAME}
+ PRIVATE ${ABSL_CC_LIB_COPTS})
+ target_link_libraries(${_NAME}
+ PUBLIC ${ABSL_CC_LIB_DEPS}
+ PRIVATE ${ABSL_CC_LIB_LINKOPTS}
+ )
+ target_compile_definitions(${_NAME} PUBLIC ${ABSL_CC_LIB_DEFINES})
+
+ # Add all Abseil targets to a a folder in the IDE for organization.
+ if(ABSL_CC_LIB_PUBLIC)
+ set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER})
+ elseif(ABSL_CC_LIB_TESTONLY)
+ set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/test)
+ else()
+ set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/internal)
+ endif()
+
+ # INTERFACE libraries can't have the CXX_STANDARD property set
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+ else()
+ # Generating header-only library
+ add_library(${_NAME} INTERFACE)
+ target_include_directories(${_NAME}
+ INTERFACE ${ABSL_COMMON_INCLUDE_DIRS})
+ target_link_libraries(${_NAME}
+ INTERFACE ${ABSL_CC_LIB_DEPS} ${ABSL_CC_LIB_LINKOPTS}
+ )
+ target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
+ endif()
+
+ add_library(absl::${ABSL_CC_LIB_NAME} ALIAS ${_NAME})
+ endif()
+endfunction()
+
+# absl_cc_test()
+#
+# CMake function to imitate Bazel's cc_test rule.
+#
+# Parameters:
+# NAME: name of target (see Usage below)
+# SRCS: List of source files for the binary
+# DEPS: List of other libraries to be linked in to the binary targets
+# COPTS: List of private compile options
+# DEFINES: List of public defines
+# LINKOPTS: List of link options
+#
+# Note:
+# By default, absl_cc_test will always create a binary named absl_${NAME}.
+# This will also add it to ctest list as absl_${NAME}.
+#
+# Usage:
+# absl_cc_library(
+# NAME
+# awesome
+# HDRS
+# "a.h"
+# SRCS
+# "a.cc"
+# PUBLIC
+# )
+#
+# absl_cc_test(
+# NAME
+# awesome_test
+# SRCS
+# "awesome_test.cc"
+# DEPS
+# absl::awesome
+# gmock
+# gtest_main
+# )
+function(absl_cc_test)
+ if(NOT ABSL_RUN_TESTS)
+ return()
+ endif()
+
+ cmake_parse_arguments(ABSL_CC_TEST
+ ""
+ "NAME"
+ "SRCS;COPTS;DEFINES;LINKOPTS;DEPS"
+ ${ARGN}
+ )
+
+ set(_NAME "absl_${ABSL_CC_TEST_NAME}")
+ add_executable(${_NAME} "")
+ target_sources(${_NAME} PRIVATE ${ABSL_CC_TEST_SRCS})
+ target_include_directories(${_NAME}
+ PUBLIC ${ABSL_COMMON_INCLUDE_DIRS}
+ PRIVATE ${GMOCK_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
+ )
+ target_compile_definitions(${_NAME}
+ PUBLIC ${ABSL_CC_TEST_DEFINES}
+ )
+ target_compile_options(${_NAME}
+ PRIVATE ${ABSL_CC_TEST_COPTS}
+ )
+ target_link_libraries(${_NAME}
+ PUBLIC ${ABSL_CC_TEST_DEPS}
+ PRIVATE ${ABSL_CC_TEST_LINKOPTS}
+ )
+ # Add all Abseil targets to a a folder in the IDE for organization.
+ set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER}/test)
+
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
+ set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+
+ add_test(NAME ${_NAME} COMMAND ${_NAME})
+endfunction()
+
+
+function(check_target my_target)
+ if(NOT TARGET ${my_target})
+ message(FATAL_ERROR " ABSL: compiling absl requires a ${my_target} CMake target in your project,
+ see CMake/README.md for more details")
+ endif(NOT TARGET ${my_target})
+endfunction()
diff --git a/linux/include/abseil-cpp/CMake/CMakeLists.txt.in b/linux/include/abseil-cpp/CMake/CMakeLists.txt.in
new file mode 100644
index 000000000..d60a33e9a
--- /dev/null
+++ b/linux/include/abseil-cpp/CMake/CMakeLists.txt.in
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 2.8.2)
+
+project(googletest-download NONE)
+
+include(ExternalProject)
+ExternalProject_Add(googletest
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG master
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
+ BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ TEST_COMMAND ""
+)
\ No newline at end of file
diff --git a/linux/include/abseil-cpp/CMake/DownloadGTest.cmake b/linux/include/abseil-cpp/CMake/DownloadGTest.cmake
new file mode 100644
index 000000000..3c682aef0
--- /dev/null
+++ b/linux/include/abseil-cpp/CMake/DownloadGTest.cmake
@@ -0,0 +1,32 @@
+# Downloads and unpacks googletest at configure time. Based on the instructions
+# at https://github.com/google/googletest/tree/master/googletest#incorporating-into-an-existing-cmake-project
+
+# Download the latest googletest from Github master
+configure_file(
+ ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in
+ ${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt
+)
+
+# Configure and build the downloaded googletest source
+execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
+ RESULT_VARIABLE result
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
+if(result)
+ message(FATAL_ERROR "CMake step for googletest failed: ${result}")
+endif()
+
+execute_process(COMMAND ${CMAKE_COMMAND} --build .
+ RESULT_VARIABLE result
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
+if(result)
+ message(FATAL_ERROR "Build step for googletest failed: ${result}")
+endif()
+
+# Prevent overriding the parent project's compiler/linker settings on Windows
+set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+
+# Add googletest directly to our build. This defines the gtest and gtest_main
+# targets.
+add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
+ ${CMAKE_BINARY_DIR}/googletest-build
+ EXCLUDE_FROM_ALL)
diff --git a/linux/include/abseil-cpp/CMake/README.md b/linux/include/abseil-cpp/CMake/README.md
new file mode 100644
index 000000000..66c376929
--- /dev/null
+++ b/linux/include/abseil-cpp/CMake/README.md
@@ -0,0 +1,107 @@
+# Abseil CMake Build Instructions
+
+Abseil comes with a CMake build script ([CMakeLists.txt](../CMakeLists.txt))
+that can be used on a wide range of platforms ("C" stands for cross-platform.).
+If you don't have CMake installed already, you can download it for free from
+.
+
+CMake works by generating native makefiles or build projects that can
+be used in the compiler environment of your choice.
+
+For API/ABI compatibility reasons, we strongly recommend building Abseil in a
+subdirectory of your project or as an embedded dependency.
+
+## Incorporating Abseil Into a CMake Project
+
+The recommendations below are similar to those for using CMake within the
+googletest framework
+()
+
+### Step-by-Step Instructions
+
+1. If you want to build the Abseil tests, integrate the Abseil dependency
+[Google Test](https://github.com/google/googletest) into your CMake project. To disable Abseil tests, you have to pass
+`-DBUILD_TESTING=OFF` when configuring your project with CMake.
+
+2. Download Abseil and copy it into a subdirectory in your CMake project or add
+Abseil as a [git submodule](https://git-scm.com/docs/git-submodule) in your
+CMake project.
+
+3. You can then use the CMake command
+[`add_subdirectory()`](https://cmake.org/cmake/help/latest/command/add_subdirectory.html)
+to include Abseil directly in your CMake project.
+
+4. Add the **absl::** target you wish to use to the
+[`target_link_libraries()`](https://cmake.org/cmake/help/latest/command/target_link_libraries.html)
+section of your executable or of your library.
+Here is a short CMakeLists.txt example of a project file using Abseil.
+
+```cmake
+cmake_minimum_required(VERSION 2.8.12)
+project(my_project)
+
+set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ ${CMAKE_CXX_FLAGS}")
+
+if(MSVC)
+ # /wd4005 macro-redefinition
+ # /wd4068 unknown pragma
+ # /wd4244 conversion from 'type1' to 'type2'
+ # /wd4267 conversion from 'size_t' to 'type2'
+ # /wd4800 force value to bool 'true' or 'false' (performance warning)
+ add_compile_options(/wd4005 /wd4068 /wd4244 /wd4267 /wd4800)
+ add_definitions(/DNOMINMAX /DWIN32_LEAN_AND_MEAN=1 /D_CRT_SECURE_NO_WARNINGS)
+endif()
+
+add_subdirectory(abseil-cpp)
+
+add_executable(my_exe source.cpp)
+target_link_libraries(my_exe absl::base absl::synchronization absl::strings)
+```
+
+### Running Abseil Tests with CMake
+
+Use the `-DABSL_RUN_TESTS=ON` flag to run Abseil tests. Note that if the `-DBUILD_TESTING=OFF` flag is passed then Abseil tests will not be run.
+
+You will need to provide Abseil with a Googletest dependency. There are two
+options for how to do this:
+
+* Use `-DABSL_USE_GOOGLETEST_HEAD`. This will automatically download the latest
+Googletest source into the build directory at configure time. Googletest will
+then be compiled directly alongside Abseil's tests.
+* Manually integrate Googletest with your build. See
+https://github.com/google/googletest/blob/master/googletest/README.md#using-cmake
+for more information on using Googletest in a CMake project.
+
+For example, to run just the Abseil tests, you could use this script:
+
+```
+cd path/to/abseil-cpp
+mkdir build
+cd build
+cmake -DABSL_USE_GOOGLETEST_HEAD=ON -DABSL_RUN_TESTS=ON ..
+make -j
+ctest
+```
+
+Currently, we only run our tests with CMake in a Linux environment, but we are
+working on the rest of our supported platforms. See
+https://github.com/abseil/abseil-cpp/projects/1 and
+https://github.com/abseil/abseil-cpp/issues/109 for more information.
+
+### Available Abseil CMake Public Targets
+
+Here's a non-exhaustive list of Abseil CMake public targets:
+
+```cmake
+absl::base
+absl::algorithm
+absl::debugging
+absl::flat_hash_map
+absl::memory
+absl::meta
+absl::numeric
+absl::strings
+absl::synchronization
+absl::time
+absl::utility
+```
diff --git a/linux/include/abseil-cpp/CMakeLists.txt b/linux/include/abseil-cpp/CMakeLists.txt
new file mode 100644
index 000000000..380ed74f7
--- /dev/null
+++ b/linux/include/abseil-cpp/CMakeLists.txt
@@ -0,0 +1,92 @@
+#
+# Copyright 2017 The Abseil Authors.
+#
+# Licensed 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.
+#
+
+# We require 3.0 for modern, target-based CMake. We require 3.1 for the use of
+# CXX_STANDARD in our targets.
+cmake_minimum_required(VERSION 3.1)
+
+# Compiler id for Apple Clang is now AppleClang.
+if (POLICY CMP0025)
+ cmake_policy(SET CMP0025 NEW)
+endif()
+
+project(absl)
+
+list(APPEND CMAKE_MODULE_PATH
+ ${CMAKE_CURRENT_LIST_DIR}/CMake
+ ${CMAKE_CURRENT_LIST_DIR}/absl/copts
+)
+
+include(GNUInstallDirs)
+include(AbseilHelpers)
+
+
+##
+## Using absl targets
+##
+## all public absl targets are
+## exported with the absl:: prefix
+##
+## e.g absl::base absl::synchronization absl::strings ....
+##
+## DO NOT rely on the internal targets outside of the prefix
+
+
+# include current path
+list(APPEND ABSL_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
+
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ set(ABSL_USING_CLANG ON)
+else()
+ set(ABSL_USING_CLANG OFF)
+endif()
+
+# find dependencies
+## pthread
+find_package(Threads REQUIRED)
+
+option(ABSL_USE_GOOGLETEST_HEAD
+ "If ON, abseil will download HEAD from googletest at config time." OFF)
+
+option(ABSL_RUN_TESTS "If ON, Abseil tests will be run." OFF)
+
+if(${ABSL_RUN_TESTS})
+ # enable CTest. This will set BUILD_TESTING to ON unless otherwise specified
+ # on the command line
+ include(CTest)
+ enable_testing()
+endif()
+
+## check targets
+if(BUILD_TESTING)
+
+ if(${ABSL_USE_GOOGLETEST_HEAD})
+ include(CMake/DownloadGTest.cmake)
+ endif()
+
+ check_target(gtest)
+ check_target(gtest_main)
+ check_target(gmock)
+
+ list(APPEND ABSL_TEST_COMMON_LIBRARIES
+ gtest_main
+ gtest
+ gmock
+ ${CMAKE_THREAD_LIBS_INIT}
+ )
+endif()
+
+add_subdirectory(absl)
diff --git a/linux/include/abseil-cpp/CONTRIBUTING.md b/linux/include/abseil-cpp/CONTRIBUTING.md
new file mode 100644
index 000000000..f4cb4a29e
--- /dev/null
+++ b/linux/include/abseil-cpp/CONTRIBUTING.md
@@ -0,0 +1,138 @@
+# How to Contribute to Abseil
+
+We'd love to accept your patches and contributions to this project. There are
+just a few small guidelines you need to follow.
+
+NOTE: If you are new to GitHub, please start by reading [Pull Request
+howto](https://help.github.com/articles/about-pull-requests/)
+
+## Contributor License Agreement
+
+Contributions to this project must be accompanied by a Contributor License
+Agreement. You (or your employer) retain the copyright to your contribution,
+this simply gives us permission to use and redistribute your contributions as
+part of the project. Head over to to see
+your current agreements on file or to sign a new one.
+
+You generally only need to submit a CLA once, so if you've already submitted one
+(even if it was for a different project), you probably don't need to do it
+again.
+
+## Contribution Guidelines
+
+Potential contributors sometimes ask us if the Abseil project is the appropriate
+home for their utility library code or for specific functions implementing
+missing portions of the standard. Often, the answer to this question is "no".
+We’d like to articulate our thinking on this issue so that our choices can be
+understood by everyone and so that contributors can have a better intuition
+about whether Abseil might be interested in adopting a new library.
+
+### Priorities
+
+Although our mission is to augment the C++ standard library, our goal is not to
+provide a full forward-compatible implementation of the latest standard. For us
+to consider a library for inclusion in Abseil, it is not enough that a library
+is useful. We generally choose to release a library when it meets at least one
+of the following criteria:
+
+* **Widespread usage** - Using our internal codebase to help gauge usage, most
+ of the libraries we've released have tens of thousands of users.
+* **Anticipated widespread usage** - Pre-adoption of some standard-compliant
+ APIs may not have broad adoption initially but can be expected to pick up
+ usage when it replaces legacy APIs. `absl::from_chars`, for example,
+ replaces existing code that converts strings to numbers and will therefore
+ likely see usage growth.
+* **High impact** - APIs that provide a key solution to a specific problem,
+ such as `absl::FixedArray`, have higher impact than usage numbers may signal
+ and are released because of their importance.
+* **Direct support for a library that falls under one of the above** - When we
+ want access to a smaller library as an implementation detail for a
+ higher-priority library we plan to release, we may release it, as we did
+ with portions of `absl/meta/type_traits.h`. One consequence of this is that
+ the presence of a library in Abseil does not necessarily mean that other
+ similar libraries would be a high priority.
+
+### API Freeze Consequences
+
+Via the
+[Abseil Compatibility Guidelines](https://abseil.io/about/compatibility), we
+have promised a large degree of API stability. In particular, we will not make
+backward-incompatible changes to released APIs without also shipping a tool or
+process that can upgrade our users' code. We are not yet at the point of easily
+releasing such tools. Therefore, at this time, shipping a library establishes an
+API contract which is borderline unchangeable. (We can add new functionality,
+but we cannot easily change existing behavior.) This constraint forces us to
+very carefully review all APIs that we ship.
+
+
+## Coding Style
+
+To keep the source consistent, readable, diffable and easy to merge, we use a
+fairly rigid coding style, as defined by the
+[google-styleguide](https://github.com/google/styleguide) project. All patches
+will be expected to conform to the style outlined
+[here](https://google.github.io/styleguide/cppguide.html).
+
+## Guidelines for Pull Requests
+
+* If you are a Googler, it is preferable to first create an internal CL and
+ have it reviewed and submitted. The code propagation process will deliver
+ the change to GitHub.
+
+* Create **small PRs** that are narrowly focused on **addressing a single
+ concern**. We often receive PRs that are trying to fix several things at a
+ time, but if only one fix is considered acceptable, nothing gets merged and
+ both author's & review's time is wasted. Create more PRs to address
+ different concerns and everyone will be happy.
+
+* For speculative changes, consider opening an [Abseil
+ issue](https://github.com/abseil/abseil-cpp/issues) and discussing it first.
+ If you are suggesting a behavioral or API change, consider starting with an
+ [Abseil proposal template](ABSEIL_ISSUE_TEMPLATE.md).
+
+* Provide a good **PR description** as a record of **what** change is being
+ made and **why** it was made. Link to a GitHub issue if it exists.
+
+* Don't fix code style and formatting unless you are already changing that
+ line to address an issue. Formatting of modified lines may be done using
+ `git clang-format`. PRs with irrelevant changes won't be merged. If
+ you do want to fix formatting or style, do that in a separate PR.
+
+* Unless your PR is trivial, you should expect there will be reviewer comments
+ that you'll need to address before merging. We expect you to be reasonably
+ responsive to those comments, otherwise the PR will be closed after 2-3
+ weeks of inactivity.
+
+* Maintain **clean commit history** and use **meaningful commit messages**.
+ PRs with messy commit history are difficult to review and won't be merged.
+ Use `rebase -i upstream/master` to curate your commit history and/or to
+ bring in latest changes from master (but avoid rebasing in the middle of a
+ code review).
+
+* Keep your PR up to date with upstream/master (if there are merge conflicts,
+ we can't really merge your change).
+
+* **All tests need to be passing** before your change can be merged. We
+ recommend you **run tests locally** (see below)
+
+* Exceptions to the rules can be made if there's a compelling reason for doing
+ so. That is - the rules are here to serve us, not the other way around, and
+ the rules need to be serving their intended purpose to be valuable.
+
+* All submissions, including submissions by project members, require review.
+
+## Running Tests
+
+Use "bazel test <>" functionality to run the unit tests.
+
+Prerequisites for building and running tests are listed in
+[README.md](README.md)
+
+## Abseil Committers
+
+The current members of the Abseil engineering team are the only committers at
+present.
+
+## Release Process
+
+Abseil lives at head, where latest-and-greatest code can be found.
diff --git a/linux/include/abseil-cpp/LICENSE b/linux/include/abseil-cpp/LICENSE
new file mode 100644
index 000000000..6b0b1270f
--- /dev/null
+++ b/linux/include/abseil-cpp/LICENSE
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/linux/include/abseil-cpp/LTS.md b/linux/include/abseil-cpp/LTS.md
new file mode 100644
index 000000000..08606f157
--- /dev/null
+++ b/linux/include/abseil-cpp/LTS.md
@@ -0,0 +1,14 @@
+# Long Term Support (LTS) Branches
+
+This repository contains periodic snapshots of the Abseil codebase that are
+Long Term Support (LTS) branches. An LTS branch allows you to use a known
+version of Abseil without interfering with other projects which may also, in
+turn, use Abseil. (For more information about our releases, see the
+[Abseil Release Management](https://abseil.io/about/releases) guide.)
+
+## LTS Branches
+
+The following lists LTS branches and the dates on which they have been released:
+
+* [LTS Branch December 18, 2018](https://github.com/abseil/abseil-cpp/tree/lts_2018_12_18/)
+* [LTS Branch June 20, 2018](https://github.com/abseil/abseil-cpp/tree/lts_2018_06_20/)
diff --git a/linux/include/abseil-cpp/README.md b/linux/include/abseil-cpp/README.md
new file mode 100644
index 000000000..e9362be2d
--- /dev/null
+++ b/linux/include/abseil-cpp/README.md
@@ -0,0 +1,114 @@
+# Abseil - C++ Common Libraries
+
+The repository contains the Abseil C++ library code. Abseil is an open-source
+collection of C++ code (compliant to C++11) designed to augment the C++
+standard library.
+
+## Table of Contents
+
+- [About Abseil](#about)
+- [Quickstart](#quickstart)
+- [Building Abseil](#build)
+- [Codemap](#codemap)
+- [License](#license)
+- [Links](#links)
+
+
+## About Abseil
+
+Abseil is an open-source collection of C++ library code designed to augment
+the C++ standard library. The Abseil library code is collected from Google's
+own C++ code base, has been extensively tested and used in production, and
+is the same code we depend on in our daily coding lives.
+
+In some cases, Abseil provides pieces missing from the C++ standard; in
+others, Abseil provides alternatives to the standard for special needs
+we've found through usage in the Google code base. We denote those cases
+clearly within the library code we provide you.
+
+Abseil is not meant to be a competitor to the standard library; we've
+just found that many of these utilities serve a purpose within our code
+base, and we now want to provide those resources to the C++ community as
+a whole.
+
+
+## Quickstart
+
+If you want to just get started, make sure you at least run through the
+[Abseil Quickstart](https://abseil.io/docs/cpp/quickstart). The Quickstart
+contains information about setting up your development environment, downloading
+the Abseil code, running tests, and getting a simple binary working.
+
+
+## Building Abseil
+
+[Bazel](http://bazel.build) is the official build system for Abseil,
+which is supported on most major platforms (Linux, Windows, MacOS, for example)
+and compilers. See the [quickstart](https://abseil.io/docs/cpp/quickstart) for
+more information on building Abseil using the Bazel build system.
+
+
+If you require CMake support, please check the
+[CMake build instructions](CMake/README.md).
+
+## Codemap
+
+Abseil contains the following C++ library components:
+
+* [`base`](absl/base/) Abseil Fundamentals
+
The `base` library contains initialization code and other code which
+ all other Abseil code depends on. Code within `base` may not depend on any
+ other code (other than the C++ standard library).
+* [`algorithm`](absl/algorithm/)
+
The `algorithm` library contains additions to the C++ ``
+ library and container-based versions of such algorithms.
+* [`container`](absl/container/)
+
The `container` library contains additional STL-style containers,
+ including Abseil's unordered "Swiss table" containers.
+* [`debugging`](absl/debugging/)
+
The `debugging` library contains code useful for enabling leak
+ checks, and stacktrace and symbolization utilities.
+* [`hash`](absl/hash/)
+
The `hash` library contains the hashing framework and default hash
+ functor implementations for hashable types in Abseil.
+* [`memory`](absl/memory/)
+
The `memory` library contains C++11-compatible versions of
+ `std::make_unique()` and related memory management facilities.
+* [`meta`](absl/meta/)
+
The `meta` library contains C++11-compatible versions of type checks
+ available within C++14 and C++17 versions of the C++ `` library.
+* [`numeric`](absl/numeric/)
+
The `numeric` library contains C++11-compatible 128-bit integers.
+* [`strings`](absl/strings/)
+
The `strings` library contains a variety of strings routines and
+ utilities, including a C++11-compatible version of the C++17
+ `std::string_view` type.
+* [`synchronization`](absl/synchronization/)
+
The `synchronization` library contains concurrency primitives (Abseil's
+ `absl::Mutex` class, an alternative to `std::mutex`) and a variety of
+ synchronization abstractions.
+* [`time`](absl/time/)
+
The `time` library contains abstractions for computing with absolute
+ points in time, durations of time, and formatting and parsing time within
+ time zones.
+* [`types`](absl/types/)
+
The `types` library contains non-container utility types, like a
+ C++11-compatible version of the C++17 `std::optional` type.
+* [`utility`](absl/utility/)
+
The `utility` library contains utility and helper code.
+
+## License
+
+The Abseil C++ library is licensed under the terms of the Apache
+license. See [LICENSE](LICENSE) for more information.
+
+## Links
+
+For more information about Abseil:
+
+* Consult our [Abseil Introduction](http://abseil.io/about/intro)
+* Read [Why Adopt Abseil](http://abseil.io/about/philosophy) to understand our
+ design philosophy.
+* Peruse our
+ [Abseil Compatibility Guarantees](http://abseil.io/about/compatibility) to
+ understand both what we promise to you, and what we expect of you in return.
diff --git a/linux/include/abseil-cpp/UPGRADES.md b/linux/include/abseil-cpp/UPGRADES.md
new file mode 100644
index 000000000..edbc4dc4d
--- /dev/null
+++ b/linux/include/abseil-cpp/UPGRADES.md
@@ -0,0 +1,17 @@
+# C++ Upgrade Tools
+
+Abseil may occassionally release API-breaking changes. As noted in our
+[Compatibility Guidelines][compatibility-guide], we will aim to provide a tool
+to do the work of effecting such API-breaking changes, when absolutely
+necessary.
+
+These tools will be listed on the [C++ Upgrade Tools][upgrade-tools] guide on
+http://abseil.io.
+
+For more information, the [C++ Automated Upgrade Guide][api-upgrades-guide]
+outlines this process.
+
+[compatibility-guide]: https://abseil.io/about/compatibility
+[api-upgrades-guide]: https://abseil.io/docs/cpp/tools/api-upgrades
+[upgrade-tools]: https://abseil.io/docs/cpp/tools/upgrades/
+
diff --git a/linux/include/abseil-cpp/WORKSPACE b/linux/include/abseil-cpp/WORKSPACE
new file mode 100644
index 000000000..72ef13980
--- /dev/null
+++ b/linux/include/abseil-cpp/WORKSPACE
@@ -0,0 +1,29 @@
+workspace(name = "com_google_absl")
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+# Bazel toolchains
+http_archive(
+ name = "bazel_toolchains",
+ urls = [
+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/bc09b995c137df042bb80a395b73d7ce6f26afbe.tar.gz",
+ "https://github.com/bazelbuild/bazel-toolchains/archive/bc09b995c137df042bb80a395b73d7ce6f26afbe.tar.gz",
+ ],
+ strip_prefix = "bazel-toolchains-bc09b995c137df042bb80a395b73d7ce6f26afbe",
+ sha256 = "4329663fe6c523425ad4d3c989a8ac026b04e1acedeceb56aa4b190fa7f3973c",
+)
+
+# GoogleTest/GoogleMock framework. Used by most unit-tests.
+http_archive(
+ name = "com_google_googletest",
+ urls = ["https://github.com/google/googletest/archive/b4d4438df9479675a632b2f11125e57133822ece.zip"], # 2018-07-16
+ strip_prefix = "googletest-b4d4438df9479675a632b2f11125e57133822ece",
+ sha256 = "5aaa5d566517cae711e2a3505ea9a6438be1b37fcaae0ebcb96ccba9aa56f23a",
+)
+
+# Google benchmark.
+http_archive(
+ name = "com_github_google_benchmark",
+ urls = ["https://github.com/google/benchmark/archive/16703ff83c1ae6d53e5155df3bb3ab0bc96083be.zip"],
+ strip_prefix = "benchmark-16703ff83c1ae6d53e5155df3bb3ab0bc96083be",
+ sha256 = "59f918c8ccd4d74b6ac43484467b500f1d64b40cc1010daa055375b322a43ba3",
+)
diff --git a/linux/include/abseil-cpp/absl/BUILD.bazel b/linux/include/abseil-cpp/absl/BUILD.bazel
new file mode 100644
index 000000000..edd0274c5
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/BUILD.bazel
@@ -0,0 +1,51 @@
+#
+# Copyright 2017 The Abseil Authors.
+#
+# Licensed 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.
+#
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Apache 2.0
+
+load(":compiler_config_setting.bzl", "create_llvm_config")
+
+create_llvm_config(
+ name = "llvm_compiler",
+ visibility = [":__subpackages__"],
+)
+
+# following configs are based on mapping defined in: https://git.io/v5Ijz
+config_setting(
+ name = "ios",
+ values = {
+ "cpu": "darwin",
+ },
+ visibility = [":__subpackages__"],
+)
+
+config_setting(
+ name = "windows",
+ values = {
+ "cpu": "x64_windows",
+ },
+ visibility = [":__subpackages__"],
+)
+
+config_setting(
+ name = "ppc",
+ values = {
+ "cpu": "ppc",
+ },
+ visibility = [":__subpackages__"],
+)
diff --git a/linux/include/abseil-cpp/absl/CMakeLists.txt b/linux/include/abseil-cpp/absl/CMakeLists.txt
new file mode 100644
index 000000000..1d09b1935
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/CMakeLists.txt
@@ -0,0 +1,31 @@
+#
+# Copyright 2017 The Abseil Authors.
+#
+# Licensed 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.
+#
+
+
+
+add_subdirectory(base)
+add_subdirectory(algorithm)
+add_subdirectory(container)
+add_subdirectory(debugging)
+add_subdirectory(hash)
+add_subdirectory(memory)
+add_subdirectory(meta)
+add_subdirectory(numeric)
+add_subdirectory(strings)
+add_subdirectory(synchronization)
+add_subdirectory(time)
+add_subdirectory(types)
+add_subdirectory(utility)
diff --git a/linux/include/abseil-cpp/absl/algorithm/BUILD.bazel b/linux/include/abseil-cpp/absl/algorithm/BUILD.bazel
new file mode 100644
index 000000000..4314ee869
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/algorithm/BUILD.bazel
@@ -0,0 +1,81 @@
+#
+# Copyright 2017 The Abseil Authors.
+#
+# Licensed 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.
+#
+
+load(
+ "//absl:copts/configure_copts.bzl",
+ "ABSL_DEFAULT_COPTS",
+ "ABSL_TEST_COPTS",
+)
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Apache 2.0
+
+cc_library(
+ name = "algorithm",
+ hdrs = ["algorithm.h"],
+ copts = ABSL_DEFAULT_COPTS,
+)
+
+cc_test(
+ name = "algorithm_test",
+ size = "small",
+ srcs = ["algorithm_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ deps = [
+ ":algorithm",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
+cc_test(
+ name = "algorithm_benchmark",
+ srcs = ["equal_benchmark.cc"],
+ copts = ABSL_TEST_COPTS,
+ tags = ["benchmark"],
+ deps = [
+ ":algorithm",
+ "//absl/base:core_headers",
+ "@com_github_google_benchmark//:benchmark_main",
+ ],
+)
+
+cc_library(
+ name = "container",
+ hdrs = [
+ "container.h",
+ ],
+ copts = ABSL_DEFAULT_COPTS,
+ deps = [
+ ":algorithm",
+ "//absl/base:core_headers",
+ "//absl/meta:type_traits",
+ ],
+)
+
+cc_test(
+ name = "container_test",
+ srcs = ["container_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ deps = [
+ ":container",
+ "//absl/base",
+ "//absl/base:core_headers",
+ "//absl/memory",
+ "//absl/types:span",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
diff --git a/linux/include/abseil-cpp/absl/algorithm/CMakeLists.txt b/linux/include/abseil-cpp/absl/algorithm/CMakeLists.txt
new file mode 100644
index 000000000..87a165c06
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/algorithm/CMakeLists.txt
@@ -0,0 +1,63 @@
+#
+# Copyright 2017 The Abseil Authors.
+#
+# Licensed 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.
+#
+
+absl_cc_library(
+ NAME
+ algorithm
+ HDRS
+ "algorithm.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ PUBLIC
+)
+
+absl_cc_test(
+ NAME
+ algorithm_test
+ SRCS
+ "algorithm_test.cc"
+ DEPS
+ absl::algorithm
+ gmock_main
+)
+
+absl_cc_library(
+ NAME
+ algorithm_container
+ HDRS
+ "container.h"
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::algorithm
+ absl::core_headers
+ absl::meta
+ PUBLIC
+)
+
+absl_cc_test(
+ NAME
+ container_test
+ SRCS
+ "container_test.cc"
+ DEPS
+ absl::algorithm_container
+ absl::base
+ absl::core_headers
+ absl::memory
+ absl::span
+ gmock_main
+)
diff --git a/linux/include/abseil-cpp/absl/algorithm/algorithm.h b/linux/include/abseil-cpp/absl/algorithm/algorithm.h
new file mode 100644
index 000000000..3d6586439
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/algorithm/algorithm.h
@@ -0,0 +1,150 @@
+// Copyright 2017 The Abseil Authors.
+//
+// Licensed 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.
+//
+// -----------------------------------------------------------------------------
+// File: algorithm.h
+// -----------------------------------------------------------------------------
+//
+// This header file contains Google extensions to the standard C++
+// header.
+
+#ifndef ABSL_ALGORITHM_ALGORITHM_H_
+#define ABSL_ALGORITHM_ALGORITHM_H_
+
+#include
+#include
+#include
+
+namespace absl {
+
+namespace algorithm_internal {
+
+// Performs comparisons with operator==, similar to C++14's `std::equal_to<>`.
+struct EqualTo {
+ template
+ bool operator()(const T& a, const U& b) const {
+ return a == b;
+ }
+};
+
+template
+bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
+ InputIter2 last2, Pred pred, std::input_iterator_tag,
+ std::input_iterator_tag) {
+ while (true) {
+ if (first1 == last1) return first2 == last2;
+ if (first2 == last2) return false;
+ if (!pred(*first1, *first2)) return false;
+ ++first1;
+ ++first2;
+ }
+}
+
+template
+bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
+ InputIter2 last2, Pred&& pred, std::random_access_iterator_tag,
+ std::random_access_iterator_tag) {
+ return (last1 - first1 == last2 - first2) &&
+ std::equal(first1, last1, first2, std::forward(pred));
+}
+
+// When we are using our own internal predicate that just applies operator==, we
+// forward to the non-predicate form of std::equal. This enables an optimization
+// in libstdc++ that can result in std::memcmp being used for integer types.
+template
+bool EqualImpl(InputIter1 first1, InputIter1 last1, InputIter2 first2,
+ InputIter2 last2, algorithm_internal::EqualTo /* unused */,
+ std::random_access_iterator_tag,
+ std::random_access_iterator_tag) {
+ return (last1 - first1 == last2 - first2) &&
+ std::equal(first1, last1, first2);
+}
+
+template
+It RotateImpl(It first, It middle, It last, std::true_type) {
+ return std::rotate(first, middle, last);
+}
+
+template
+It RotateImpl(It first, It middle, It last, std::false_type) {
+ std::rotate(first, middle, last);
+ return std::next(first, std::distance(middle, last));
+}
+
+} // namespace algorithm_internal
+
+// Compares the equality of two ranges specified by pairs of iterators, using
+// the given predicate, returning true iff for each corresponding iterator i1
+// and i2 in the first and second range respectively, pred(*i1, *i2) == true
+//
+// This comparison takes at most min(`last1` - `first1`, `last2` - `first2`)
+// invocations of the predicate. Additionally, if InputIter1 and InputIter2 are
+// both random-access iterators, and `last1` - `first1` != `last2` - `first2`,
+// then the predicate is never invoked and the function returns false.
+//
+// This is a C++11-compatible implementation of C++14 `std::equal`. See
+// http://en.cppreference.com/w/cpp/algorithm/equal for more information.
+template
+bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
+ InputIter2 last2, Pred&& pred) {
+ return algorithm_internal::EqualImpl(
+ first1, last1, first2, last2, std::forward(pred),
+ typename std::iterator_traits::iterator_category{},
+ typename std::iterator_traits::iterator_category{});
+}
+
+// Performs comparison of two ranges specified by pairs of iterators using
+// operator==.
+template
+bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
+ InputIter2 last2) {
+ return absl::equal(first1, last1, first2, last2,
+ algorithm_internal::EqualTo{});
+}
+
+// Performs a linear search for `value` using the iterator `first` up to
+// but not including `last`, returning true if [`first`, `last`) contains an
+// element equal to `value`.
+//
+// A linear search is of O(n) complexity which is guaranteed to make at most
+// n = (`last` - `first`) comparisons. A linear search over short containers
+// may be faster than a binary search, even when the container is sorted.
+template
+bool linear_search(InputIterator first, InputIterator last,
+ const EqualityComparable& value) {
+ return std::find(first, last, value) != last;
+}
+
+// Performs a left rotation on a range of elements (`first`, `last`) such that
+// `middle` is now the first element. `rotate()` returns an iterator pointing to
+// the first element before rotation. This function is exactly the same as
+// `std::rotate`, but fixes a bug in gcc
+// <= 4.9 where `std::rotate` returns `void` instead of an iterator.
+//
+// The complexity of this algorithm is the same as that of `std::rotate`, but if
+// `ForwardIterator` is not a random-access iterator, then `absl::rotate`
+// performs an additional pass over the range to construct the return value.
+
+template
+ForwardIterator rotate(ForwardIterator first, ForwardIterator middle,
+ ForwardIterator last) {
+ return algorithm_internal::RotateImpl(
+ first, middle, last,
+ std::is_same());
+}
+
+} // namespace absl
+
+#endif // ABSL_ALGORITHM_ALGORITHM_H_
diff --git a/linux/include/abseil-cpp/absl/algorithm/algorithm_test.cc b/linux/include/abseil-cpp/absl/algorithm/algorithm_test.cc
new file mode 100644
index 000000000..e4322bc4f
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/algorithm/algorithm_test.cc
@@ -0,0 +1,182 @@
+// Copyright 2017 The Abseil Authors.
+//
+// Licensed 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.
+
+#include "absl/algorithm/algorithm.h"
+
+#include
+#include
+#include
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+namespace {
+
+TEST(EqualTest, DefaultComparisonRandomAccess) {
+ std::vector v1{1, 2, 3};
+ std::vector v2 = v1;
+ std::vector v3 = {1, 2};
+ std::vector v4 = {1, 2, 4};
+
+ EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end()));
+}
+
+TEST(EqualTest, DefaultComparison) {
+ std::list lst1{1, 2, 3};
+ std::list lst2 = lst1;
+ std::list lst3{1, 2};
+ std::list lst4{1, 2, 4};
+
+ EXPECT_TRUE(absl::equal(lst1.begin(), lst1.end(), lst2.begin(), lst2.end()));
+ EXPECT_FALSE(absl::equal(lst1.begin(), lst1.end(), lst3.begin(), lst3.end()));
+ EXPECT_FALSE(absl::equal(lst1.begin(), lst1.end(), lst4.begin(), lst4.end()));
+}
+
+TEST(EqualTest, EmptyRange) {
+ std::vector v1{1, 2, 3};
+ std::vector empty1;
+ std::vector empty2;
+
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), empty1.begin(), empty1.end()));
+ EXPECT_FALSE(absl::equal(empty1.begin(), empty1.end(), v1.begin(), v1.end()));
+ EXPECT_TRUE(
+ absl::equal(empty1.begin(), empty1.end(), empty2.begin(), empty2.end()));
+}
+
+TEST(EqualTest, MixedIterTypes) {
+ std::vector v1{1, 2, 3};
+ std::list lst1{v1.begin(), v1.end()};
+ std::list lst2{1, 2, 4};
+ std::list lst3{1, 2};
+
+ EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), lst1.begin(), lst1.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), lst2.begin(), lst2.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), lst3.begin(), lst3.end()));
+}
+
+TEST(EqualTest, MixedValueTypes) {
+ std::vector v1{1, 2, 3};
+ std::vector v2{1, 2, 3};
+ std::vector v3{1, 2};
+ std::vector v4{1, 2, 4};
+
+ EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end()));
+}
+
+TEST(EqualTest, WeirdIterators) {
+ std::vector v1{true, false};
+ std::vector v2 = v1;
+ std::vector v3{true};
+ std::vector v4{true, true, true};
+
+ EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end()));
+}
+
+TEST(EqualTest, CustomComparison) {
+ int n[] = {1, 2, 3, 4};
+ std::vector v1{&n[0], &n[1], &n[2]};
+ std::vector v2 = v1;
+ std::vector v3{&n[0], &n[1], &n[3]};
+ std::vector v4{&n[0], &n[1]};
+
+ auto eq = [](int* a, int* b) { return *a == *b; };
+
+ EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end(), eq));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end(), eq));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end(), eq));
+}
+
+TEST(EqualTest, MoveOnlyPredicate) {
+ std::vector v1{1, 2, 3};
+ std::vector v2{4, 5, 6};
+
+ // move-only equality predicate
+ struct Eq {
+ Eq() = default;
+ Eq(Eq &&) = default;
+ Eq(const Eq &) = delete;
+ Eq &operator=(const Eq &) = delete;
+ bool operator()(const int a, const int b) const { return a == b; }
+ };
+
+ EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v1.begin(), v1.end(), Eq()));
+ EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end(), Eq()));
+}
+
+struct CountingTrivialPred {
+ int* count;
+ bool operator()(int, int) const {
+ ++*count;
+ return true;
+ }
+};
+
+TEST(EqualTest, RandomAccessComplexity) {
+ std::vector v1{1, 1, 3};
+ std::vector v2 = v1;
+ std::vector v3{1, 2};
+
+ do {
+ int count = 0;
+ absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end(),
+ CountingTrivialPred{&count});
+ EXPECT_LE(count, 3);
+ } while (std::next_permutation(v2.begin(), v2.end()));
+
+ int count = 0;
+ absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end(),
+ CountingTrivialPred{&count});
+ EXPECT_EQ(count, 0);
+}
+
+class LinearSearchTest : public testing::Test {
+ protected:
+ LinearSearchTest() : container_{1, 2, 3} {}
+
+ static bool Is3(int n) { return n == 3; }
+ static bool Is4(int n) { return n == 4; }
+
+ std::vector container_;
+};
+
+TEST_F(LinearSearchTest, linear_search) {
+ EXPECT_TRUE(absl::linear_search(container_.begin(), container_.end(), 3));
+ EXPECT_FALSE(absl::linear_search(container_.begin(), container_.end(), 4));
+}
+
+TEST_F(LinearSearchTest, linear_searchConst) {
+ const std::vector *const const_container = &container_;
+ EXPECT_TRUE(
+ absl::linear_search(const_container->begin(), const_container->end(), 3));
+ EXPECT_FALSE(
+ absl::linear_search(const_container->begin(), const_container->end(), 4));
+}
+
+TEST(RotateTest, Rotate) {
+ std::vector v{0, 1, 2, 3, 4};
+ EXPECT_EQ(*absl::rotate(v.begin(), v.begin() + 2, v.end()), 0);
+ EXPECT_THAT(v, testing::ElementsAreArray({2, 3, 4, 0, 1}));
+
+ std::list l{0, 1, 2, 3, 4};
+ EXPECT_EQ(*absl::rotate(l.begin(), std::next(l.begin(), 3), l.end()), 0);
+ EXPECT_THAT(l, testing::ElementsAreArray({3, 4, 0, 1, 2}));
+}
+
+} // namespace
diff --git a/linux/include/abseil-cpp/absl/algorithm/container.h b/linux/include/abseil-cpp/absl/algorithm/container.h
new file mode 100644
index 000000000..6d5f6630f
--- /dev/null
+++ b/linux/include/abseil-cpp/absl/algorithm/container.h
@@ -0,0 +1,1702 @@
+// Copyright 2017 The Abseil Authors.
+//
+// Licensed 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.
+//
+// -----------------------------------------------------------------------------
+// File: container.h
+// -----------------------------------------------------------------------------
+//
+// This header file provides Container-based versions of algorithmic functions
+// within the C++ standard library. The following standard library sets of
+// functions are covered within this file:
+//
+// * Algorithmic functions
+// * Algorithmic functions
+// * functions
+//
+// The standard library functions operate on iterator ranges; the functions
+// within this API operate on containers, though many return iterator ranges.
+//
+// All functions within this API are named with a `c_` prefix. Calls such as
+// `absl::c_xx(container, ...) are equivalent to std:: functions such as
+// `std::xx(std::begin(cont), std::end(cont), ...)`. Functions that act on
+// iterators but not conceptually on iterator ranges (e.g. `std::iter_swap`)
+// have no equivalent here.
+//
+// For template parameter and variable naming, `C` indicates the container type
+// to which the function is applied, `Pred` indicates the predicate object type
+// to be used by the function and `T` indicates the applicable element type.
+//
+
+#ifndef ABSL_ALGORITHM_CONTAINER_H_
+#define ABSL_ALGORITHM_CONTAINER_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "absl/algorithm/algorithm.h"
+#include "absl/base/macros.h"
+#include "absl/meta/type_traits.h"
+
+namespace absl {
+namespace container_algorithm_internal {
+
+// NOTE: it is important to defer to ADL lookup for building with C++ modules,
+// especially for headers like which are not visible from this file
+// but specialize std::begin and std::end.
+using std::begin;
+using std::end;
+
+// The type of the iterator given by begin(c) (possibly std::begin(c)).
+// ContainerIter> gives vector::const_iterator,
+// while ContainerIter> gives vector::iterator.
+template
+using ContainerIter = decltype(begin(std::declval()));
+
+// An MSVC bug involving template parameter substitution requires us to use
+// decltype() here instead of just std::pair.
+template
+using ContainerIterPairType =
+ decltype(std::make_pair(ContainerIter(), ContainerIter()));
+
+template
+using ContainerDifferenceType =
+ decltype(std::distance(std::declval>(),
+ std::declval>()));
+
+template
+using ContainerPointerType =
+ typename std::iterator_traits>::pointer;
+
+// container_algorithm_internal::c_begin and
+// container_algorithm_internal::c_end are abbreviations for proper ADL
+// lookup of std::begin and std::end, i.e.
+// using std::begin;
+// using std::end;
+// std::foo(begin(c), end(c);
+// becomes
+// std::foo(container_algorithm_internal::begin(c),
+// container_algorithm_internal::end(c));
+// These are meant for internal use only.
+
+template
+ContainerIter c_begin(C& c) { return begin(c); }
+
+template
+ContainerIter c_end(C& c) { return end(c); }
+
+template
+struct IsUnorderedContainer : std::false_type {};
+
+template
+struct IsUnorderedContainer<
+ std::unordered_map> : std::true_type {};
+
+template
+struct IsUnorderedContainer>
+ : std::true_type {};
+
+} // namespace container_algorithm_internal
+
+// PUBLIC API
+
+//------------------------------------------------------------------------------
+// Abseil algorithm.h functions
+//------------------------------------------------------------------------------
+
+// c_linear_search()
+//
+// Container-based version of absl::linear_search() for performing a linear
+// search within a container.
+template
+bool c_linear_search(const C& c, EqualityComparable&& value) {
+ return linear_search(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(value));
+}
+
+//------------------------------------------------------------------------------
+// algorithms
+//------------------------------------------------------------------------------
+
+// c_distance()
+//
+// Container-based version of the `std::distance()` function to
+// return the number of elements within a container.
+template
+container_algorithm_internal::ContainerDifferenceType c_distance(
+ const C& c) {
+ return std::distance(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c));
+}
+
+//------------------------------------------------------------------------------
+// Non-modifying sequence operations
+//------------------------------------------------------------------------------
+
+// c_all_of()
+//
+// Container-based version of the `std::all_of()` function to
+// test a condition on all elements within a container.
+template
+bool c_all_of(const C& c, Pred&& pred) {
+ return std::all_of(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred));
+}
+
+// c_any_of()
+//
+// Container-based version of the `std::any_of()` function to
+// test if any element in a container fulfills a condition.
+template
+bool c_any_of(const C& c, Pred&& pred) {
+ return std::any_of(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred));
+}
+
+// c_none_of()
+//
+// Container-based version of the `std::none_of()` function to
+// test if no elements in a container fulfil a condition.
+template
+bool c_none_of(const C& c, Pred&& pred) {
+ return std::none_of(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred));
+}
+
+// c_for_each()
+//
+// Container-based version of the `std::for_each()` function to
+// apply a function to a container's elements.
+template
+decay_t c_for_each(C&& c, Function&& f) {
+ return std::for_each(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(f));
+}
+
+// c_find()
+//
+// Container-based version of the `std::find()` function to find
+// the first element containing the passed value within a container value.
+template
+container_algorithm_internal::ContainerIter c_find(C& c, T&& value) {
+ return std::find(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(value));
+}
+
+// c_find_if()
+//
+// Container-based version of the `std::find_if()` function to find
+// the first element in a container matching the given condition.
+template
+container_algorithm_internal::ContainerIter c_find_if(C& c, Pred&& pred) {
+ return std::find_if(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred));
+}
+
+// c_find_if_not()
+//
+// Container-based version of the `std::find_if_not()` function to
+// find the first element in a container not matching the given condition.
+template
+container_algorithm_internal::ContainerIter c_find_if_not(C& c,
+ Pred&& pred) {
+ return std::find_if_not(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred));
+}
+
+// c_find_end()
+//
+// Container-based version of the `std::find_end()` function to
+// find the last subsequence within a container.
+template
+container_algorithm_internal::ContainerIter c_find_end(
+ Sequence1& sequence, Sequence2& subsequence) {
+ return std::find_end(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence),
+ container_algorithm_internal::c_begin(subsequence),
+ container_algorithm_internal::c_end(subsequence));
+}
+
+// Overload of c_find_end() for using a predicate evaluation other than `==` as
+// the function's test condition.
+template
+container_algorithm_internal::ContainerIter c_find_end(
+ Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) {
+ return std::find_end(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence),
+ container_algorithm_internal::c_begin(subsequence),
+ container_algorithm_internal::c_end(subsequence),
+ std::forward(pred));
+}
+
+// c_find_first_of()
+//
+// Container-based version of the `std::find_first_of()` function to
+// find the first elements in an ordered set within a container.
+template
+container_algorithm_internal::ContainerIter c_find_first_of(C1& container,
+ C2& options) {
+ return std::find_first_of(container_algorithm_internal::c_begin(container),
+ container_algorithm_internal::c_end(container),
+ container_algorithm_internal::c_begin(options),
+ container_algorithm_internal::c_end(options));
+}
+
+// Overload of c_find_first_of() for using a predicate evaluation other than
+// `==` as the function's test condition.
+template
+container_algorithm_internal::ContainerIter c_find_first_of(
+ C1& container, C2& options, BinaryPredicate&& pred) {
+ return std::find_first_of(container_algorithm_internal::c_begin(container),
+ container_algorithm_internal::c_end(container),
+ container_algorithm_internal::c_begin(options),
+ container_algorithm_internal::c_end(options),
+ std::forward(pred));
+}
+
+// c_adjacent_find()
+//
+// Container-based version of the `std::adjacent_find()` function to
+// find equal adjacent elements within a container.
+template
+container_algorithm_internal::ContainerIter c_adjacent_find(
+ Sequence& sequence) {
+ return std::adjacent_find(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence));
+}
+
+// Overload of c_adjacent_find() for using a predicate evaluation other than
+// `==` as the function's test condition.
+template
+container_algorithm_internal::ContainerIter c_adjacent_find(
+ Sequence& sequence, BinaryPredicate&& pred) {
+ return std::adjacent_find(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence),
+ std::forward(pred));
+}
+
+// c_count()
+//
+// Container-based version of the `std::count()` function to count
+// values that match within a container.
+template
+container_algorithm_internal::ContainerDifferenceType c_count(
+ const C& c, T&& value) {
+ return std::count(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(value));
+}
+
+// c_count_if()
+//
+// Container-based version of the `std::count_if()` function to
+// count values matching a condition within a container.
+template
+container_algorithm_internal::ContainerDifferenceType c_count_if(
+ const C& c, Pred&& pred) {
+ return std::count_if(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred));
+}
+
+// c_mismatch()
+//
+// Container-based version of the `std::mismatch()` function to
+// return the first element where two ordered containers differ.
+template
+container_algorithm_internal::ContainerIterPairType
+c_mismatch(C1& c1, C2& c2) {
+ return std::mismatch(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2));
+}
+
+// Overload of c_mismatch() for using a predicate evaluation other than `==` as
+// the function's test condition.
+template
+container_algorithm_internal::ContainerIterPairType
+c_mismatch(C1& c1, C2& c2, BinaryPredicate&& pred) {
+ return std::mismatch(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ std::forward(pred));
+}
+
+// c_equal()
+//
+// Container-based version of the `std::equal()` function to
+// test whether two containers are equal.
+//
+// NOTE: the semantics of c_equal() are slightly different than those of
+// equal(): while the latter iterates over the second container only up to the
+// size of the first container, c_equal() also checks whether the container
+// sizes are equal. This better matches expectations about c_equal() based on
+// its signature.
+//
+// Example:
+// vector v1 = <1, 2, 3>;
+// vector v2 = <1, 2, 3, 4>;
+// equal(std::begin(v1), std::end(v1), std::begin(v2)) returns true
+// c_equal(v1, v2) returns false
+
+template
+bool c_equal(const C1& c1, const C2& c2) {
+ return ((c1.size() == c2.size()) &&
+ std::equal(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2)));
+}
+
+// Overload of c_equal() for using a predicate evaluation other than `==` as
+// the function's test condition.
+template
+bool c_equal(const C1& c1, const C2& c2, BinaryPredicate&& pred) {
+ return ((c1.size() == c2.size()) &&
+ std::equal(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2),
+ std::forward(pred)));
+}
+
+// c_is_permutation()
+//
+// Container-based version of the `std::is_permutation()` function
+// to test whether a container is a permutation of another.
+template
+bool c_is_permutation(const C1& c1, const C2& c2) {
+ using std::begin;
+ using std::end;
+ return c1.size() == c2.size() &&
+ std::is_permutation(begin(c1), end(c1), begin(c2));
+}
+
+// Overload of c_is_permutation() for using a predicate evaluation other than
+// `==` as the function's test condition.
+template
+bool c_is_permutation(const C1& c1, const C2& c2, BinaryPredicate&& pred) {
+ using std::begin;
+ using std::end;
+ return c1.size() == c2.size() &&
+ std::is_permutation(begin(c1), end(c1), begin(c2),
+ std::forward(pred));
+}
+
+// c_search()
+//
+// Container-based version of the `std::search()` function to search
+// a container for a subsequence.
+template
+container_algorithm_internal::ContainerIter c_search(
+ Sequence1& sequence, Sequence2& subsequence) {
+ return std::search(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence),
+ container_algorithm_internal::c_begin(subsequence),
+ container_algorithm_internal::c_end(subsequence));
+}
+
+// Overload of c_search() for using a predicate evaluation other than
+// `==` as the function's test condition.
+template
+container_algorithm_internal::ContainerIter c_search(
+ Sequence1& sequence, Sequence2& subsequence, BinaryPredicate&& pred) {
+ return std::search(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence),
+ container_algorithm_internal::c_begin(subsequence),
+ container_algorithm_internal::c_end(subsequence),
+ std::forward(pred));
+}
+
+// c_search_n()
+//
+// Container-based version of the `std::search_n()` function to
+// search a container for the first sequence of N elements.
+template
+container_algorithm_internal::ContainerIter c_search_n(
+ Sequence& sequence, Size count, T&& value) {
+ return std::search_n(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence), count,
+ std::forward(value));
+}
+
+// Overload of c_search_n() for using a predicate evaluation other than
+// `==` as the function's test condition.
+template
+container_algorithm_internal::ContainerIter c_search_n(
+ Sequence& sequence, Size count, T&& value, BinaryPredicate&& pred) {
+ return std::search_n(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence), count,
+ std::forward(value),
+ std::forward(pred));
+}
+
+//------------------------------------------------------------------------------
+// Modifying sequence operations
+//------------------------------------------------------------------------------
+
+// c_copy()
+//
+// Container-based version of the `std::copy()` function to copy a
+// container's elements into an iterator.
+template
+OutputIterator c_copy(const InputSequence& input, OutputIterator output) {
+ return std::copy(container_algorithm_internal::c_begin(input),
+ container_algorithm_internal::c_end(input), output);
+}
+
+// c_copy_n()
+//
+// Container-based version of the `std::copy_n()` function to copy a
+// container's first N elements into an iterator.
+template
+OutputIterator c_copy_n(const C& input, Size n, OutputIterator output) {
+ return std::copy_n(container_algorithm_internal::c_begin(input), n, output);
+}
+
+// c_copy_if()
+//
+// Container-based version of the `std::copy_if()` function to copy
+// a container's elements satisfying some condition into an iterator.
+template
+OutputIterator c_copy_if(const InputSequence& input, OutputIterator output,
+ Pred&& pred) {
+ return std::copy_if(container_algorithm_internal::c_begin(input),
+ container_algorithm_internal::c_end(input), output,
+ std::forward(pred));
+}
+
+// c_copy_backward()
+//
+// Container-based version of the `std::copy_backward()` function to
+// copy a container's elements in reverse order into an iterator.
+template
+BidirectionalIterator c_copy_backward(const C& src,
+ BidirectionalIterator dest) {
+ return std::copy_backward(container_algorithm_internal::c_begin(src),
+ container_algorithm_internal::c_end(src), dest);
+}
+
+// c_move()
+//
+// Container-based version of the `std::move()` function to move
+// a container's elements into an iterator.
+template
+OutputIterator c_move(C&& src, OutputIterator dest) {
+ return std::move(container_algorithm_internal::c_begin(src),
+ container_algorithm_internal::c_end(src), dest);
+}
+
+// c_swap_ranges()
+//
+// Container-based version of the `std::swap_ranges()` function to
+// swap a container's elements with another container's elements.
+template
+container_algorithm_internal::ContainerIter c_swap_ranges(C1& c1, C2& c2) {
+ return std::swap_ranges(container_algorithm_internal::c_begin(c1),
+ container_algorithm_internal::c_end(c1),
+ container_algorithm_internal::c_begin(c2));
+}
+
+// c_transform()
+//
+// Container-based version of the `std::transform()` function to
+// transform a container's elements using the unary operation, storing the
+// result in an iterator pointing to the last transformed element in the output
+// range.
+template
+OutputIterator c_transform(const InputSequence& input, OutputIterator output,
+ UnaryOp&& unary_op) {
+ return std::transform(container_algorithm_internal::c_begin(input),
+ container_algorithm_internal::c_end(input), output,
+ std::forward(unary_op));
+}
+
+// Overload of c_transform() for performing a transformation using a binary
+// predicate.
+template
+OutputIterator c_transform(const InputSequence1& input1,
+ const InputSequence2& input2, OutputIterator output,
+ BinaryOp&& binary_op) {
+ return std::transform(container_algorithm_internal::c_begin(input1),
+ container_algorithm_internal::c_end(input1),
+ container_algorithm_internal::c_begin(input2), output,
+ std::forward(binary_op));
+}
+
+// c_replace()
+//
+// Container-based version of the `std::replace()` function to
+// replace a container's elements of some value with a new value. The container
+// is modified in place.
+template
+void c_replace(Sequence& sequence, const T& old_value, const T& new_value) {
+ std::replace(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence), old_value,
+ new_value);
+}
+
+// c_replace_if()
+//
+// Container-based version of the `std::replace_if()` function to
+// replace a container's elements of some value with a new value based on some
+// condition. The container is modified in place.
+template
+void c_replace_if(C& c, Pred&& pred, T&& new_value) {
+ std::replace_if(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(pred), std::forward(new_value));
+}
+
+// c_replace_copy()
+//
+// Container-based version of the `std::replace_copy()` function to
+// replace a container's elements of some value with a new value and return the
+// results within an iterator.
+template
+OutputIterator c_replace_copy(const C& c, OutputIterator result, T&& old_value,
+ T&& new_value) {
+ return std::replace_copy(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result,
+ std::forward(old_value),
+ std::forward(new_value));
+}
+
+// c_replace_copy_if()
+//
+// Container-based version of the `std::replace_copy_if()` function
+// to replace a container's elements of some value with a new value based on
+// some condition, and return the results within an iterator.
+template
+OutputIterator c_replace_copy_if(const C& c, OutputIterator result, Pred&& pred,
+ T&& new_value) {
+ return std::replace_copy_if(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result,
+ std::forward(pred),
+ std::forward(new_value));
+}
+
+// c_fill()
+//
+// Container-based version of the `std::fill()` function to fill a
+// container with some value.
+template
+void c_fill(C& c, T&& value) {
+ std::fill(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), std::forward(value));
+}
+
+// c_fill_n()
+//
+// Container-based version of the `std::fill_n()` function to fill
+// the first N elements in a container with some value.
+template
+void c_fill_n(C& c, Size n, T&& value) {
+ std::fill_n(container_algorithm_internal::c_begin(c), n,
+ std::forward(value));
+}
+
+// c_generate()
+//
+// Container-based version of the `std::generate()` function to
+// assign a container's elements to the values provided by the given generator.
+template
+void c_generate(C& c, Generator&& gen) {
+ std::generate(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(gen));
+}
+
+// c_generate_n()
+//
+// Container-based version of the `std::generate_n()` function to
+// assign a container's first N elements to the values provided by the given
+// generator.
+template
+container_algorithm_internal::ContainerIter c_generate_n(C& c, Size n,
+ Generator&& gen) {
+ return std::generate_n(container_algorithm_internal::c_begin(c), n,
+ std::forward(gen));
+}
+
+// Note: `c_xx()` container versions for `remove()`, `remove_if()`,
+// and `unique()` are omitted, because it's not clear whether or not such
+// functions should call erase on their supplied sequences afterwards. Either
+// behavior would be surprising for a different set of users.
+//
+
+// c_remove_copy()
+//
+// Container-based version of the `std::remove_copy()` function to
+// copy a container's elements while removing any elements matching the given
+// `value`.
+template
+OutputIterator c_remove_copy(const C& c, OutputIterator result, T&& value) {
+ return std::remove_copy(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result,
+ std::forward(value));
+}
+
+// c_remove_copy_if()
+//
+// Container-based version of the `std::remove_copy_if()` function
+// to copy a container's elements while removing any elements matching the given
+// condition.
+template
+OutputIterator c_remove_copy_if(const C& c, OutputIterator result,
+ Pred&& pred) {
+ return std::remove_copy_if(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result,
+ std::forward(pred));
+}
+
+// c_unique_copy()
+//
+// Container-based version of the `std::unique_copy()` function to
+// copy a container's elements while removing any elements containing duplicate
+// values.
+template
+OutputIterator c_unique_copy(const C& c, OutputIterator result) {
+ return std::unique_copy(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result);
+}
+
+// Overload of c_unique_copy() for using a predicate evaluation other than
+// `==` for comparing uniqueness of the element values.
+template
+OutputIterator c_unique_copy(const C& c, OutputIterator result,
+ BinaryPredicate&& pred) {
+ return std::unique_copy(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c), result,
+ std::forward(pred));
+}
+
+// c_reverse()
+//
+// Container-based version of the `std::reverse()` function to
+// reverse a container's elements.
+template
+void c_reverse(Sequence& sequence) {
+ std::reverse(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence));
+}
+
+// c_reverse_copy()
+//
+// Container-based version of the `std::reverse()` function to
+// reverse a container's elements and write them to an iterator range.
+template
+OutputIterator c_reverse_copy(const C& sequence, OutputIterator result) {
+ return std::reverse_copy(container_algorithm_internal::c_begin(sequence),
+ container_algorithm_internal::c_end(sequence),
+ result);
+}
+
+// c_rotate()
+//
+// Container-based version of the `std::rotate()` function to
+// shift a container's elements leftward such that the `middle` element becomes
+// the first element in the container.
+template >
+Iterator c_rotate(C& sequence, Iterator middle) {
+ return absl::rotate(container_algorithm_internal::c_begin(sequence), middle,
+ container_algorithm_internal::c_end(sequence));
+}
+
+// c_rotate_copy()
+//
+// Container-based version of the `std::rotate_copy()` function to
+// shift a container's elements leftward such that the `middle` element becomes
+// the first element in a new iterator range.
+template
+OutputIterator c_rotate_copy(
+ const C& sequence,
+ container_algorithm_internal::ContainerIter middle,
+ OutputIterator result) {
+ return std::rotate_copy(container_algorithm_internal::c_begin(sequence),
+ middle, container_algorithm_internal::c_end(sequence),
+ result);
+}
+
+// c_shuffle()
+//
+// Container-based version of the `std::shuffle()` function to
+// randomly shuffle elements within the container using a `gen()` uniform random
+// number generator.
+template
+void c_shuffle(RandomAccessContainer& c, UniformRandomBitGenerator&& gen) {
+ std::shuffle(container_algorithm_internal::c_begin(c),
+ container_algorithm_internal::c_end(c),
+ std::forward(gen));
+}
+
+//------------------------------------------------------------------------------
+// Partition functions
+//------------------------------------------------------------------------------
+
+// c_is_partitioned()
+//
+// Container-based version of the