Remove internal Conan package: there is now an external one

This commit is contained in:
David Yip
2019-07-08 04:21:08 -05:00
committed by Simon Brand
parent 3d741708b9
commit bcdc78bf8e
5 changed files with 2 additions and 89 deletions

View File

@@ -5,6 +5,8 @@ Single header implementation of `std::expected` with functional-style extensions
Clang + GCC: [![Linux Build Status](https://travis-ci.org/TartanLlama/expected.png?branch=master)](https://travis-ci.org/TartanLlama/expected)
MSVC: [![Windows Build Status](https://ci.appveyor.com/api/projects/status/k5x00xa11y3s5wsg?svg=true)](https://ci.appveyor.com/project/TartanLlama/expected)
Available on [Vcpkg](https://github.com/microsoft/vcpkg/tree/master/ports/tl-expected) and [Conan](https://github.com/yipdw/conan-tl-expected).
[`std::expected`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0323r3.pdf) is proposed as the preferred way to represent object which will either have an expected value, or an unexpected value giving information about why something failed. Unfortunately, chaining together many computations which may fail can be verbose, as error-checking code will be mixed in with the actual programming logic. This implementation provides a number of utilities to make coding with `expected` cleaner.
For example, instead of writing this code:

View File

@@ -1,34 +0,0 @@
from conans import ConanFile, CMake, tools
class ExpectedConan(ConanFile):
name = "expected"
version = "master"
license = "CC0-1.0"
author = "Simon Brand <tartanllama@gmail.com>"
url = "https://github.com/TartanLlama/expected"
description = "C++11/14/17 std::expected with functional-style extensions"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
exports_sources = "*"
def source(self):
tools.replace_in_file('CMakeLists.txt', 'project(tl-expected)',
'''project(tl-expected)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
''')
def configure_cmake(self):
cmake = CMake(self)
cmake.configure()
return cmake
def build(self):
cmake = self.configure_cmake()
cmake.build()
if not tools.cross_building(self.settings):
self.run('%s/bin/tests' % self.build_folder)
def package(self):
self.copy('*.hpp', dst='include/tl', src='include/tl')

View File

@@ -1,14 +0,0 @@
cmake_minimum_required(VERSION 2.8.12)
project(PackageTest CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS})
# CTest is a testing tool that can be used to test your project.
# enable_testing()
# add_test(NAME example
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
# COMMAND example)

View File

@@ -1,25 +0,0 @@
import os
from conans import ConanFile, CMake, tools
class ExpectedTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_package"
cmake.configure()
cmake.build()
def imports(self):
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
self.copy('*.so*', dst='bin', src='lib')
def test(self):
if not tools.cross_building(self.settings):
os.chdir("bin")
self.run(".%sexample" % os.sep)

View File

@@ -1,16 +0,0 @@
#include <tl/expected.hpp>
tl::expected<int, const char*> maybe_do_something(int i) {
if (i < 5) {
return 0;
}
else {
return tl::make_unexpected("Uh oh");
}
}
int main(int argc, char** argv) {
(void)argv;
return maybe_do_something(0).value_or(-1);
}