Permalink
Browse files

Initial commit

  • Loading branch information...
dlevin256 committed Jul 1, 2016
1 parent c62a812 commit fbbfb3c7a184c8a249d54b25ffb97d0acad356f8
Showing with 3,051 additions and 0 deletions.
  1. +27 −0 .clang-format
  2. +73 −0 .gitignore
  3. +41 −0 .travis.yml
  4. +23 −0 CMakeLists.txt
  5. +31 −0 README.md
  6. +26 −0 format-all.py
  7. +377 −0 include/cident.h
  8. +1,974 −0 include/cometa.hpp
  9. +397 −0 include/cometa/string.hpp
  10. +82 −0 tests/cometa_test.cpp
@@ -0,0 +1,27 @@
UseTab: Never
IndentWidth: 4
Language : Cpp
BreakBeforeBraces: Allman
MaxEmptyLinesToKeep: 1
IndentCaseLabels: false
NamespaceIndentation: None
AccessModifierOffset: -4
SpacesInParentheses: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
PointerAlignment: Left
Cpp11BracedListStyle: false
AllowShortIfStatementsOnASingleLine: false
AllowShortFunctionsOnASingleLine : true
AlignOperands: true
Standard: Cpp11
IndentCaseLabels: false
AlignTrailingComments : false
ConstructorInitializerAllOnOneLineOrOnePerLine : false
ColumnLimit: 110
BinPackParameters : true
BinPackArguments : true
AlwaysBreakTemplateDeclarations : true
AlignConsecutiveAssignments : true
PenaltyReturnTypeOnItsOwnLine: 50000
CommentPragmas: '^ >>>'
@@ -0,0 +1,73 @@
# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# CMake files
CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake

# build directory
build/

# test directory
svg/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Sphinx documentation
docs/_build/

# CLion
.idea/
@@ -0,0 +1,41 @@
sudo: required
dist: trusty
language: cpp

matrix:
include:
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
env: COMPILER=g++-5
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- g++-5
- clang-3.7
env: COMPILER=clang++-3.7
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- g++-5
- clang-3.8
env: COMPILER=clang++-3.8

before_install:
- sudo apt-get update -qq
script:
- mkdir build
- cd build
- cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release .. && make
@@ -0,0 +1,23 @@
# Copyright (C) 2016 D Levin (http://www.kfrlib.com)
# This file is part of CoMeta (C++14 metaprogramming library created for KFR framework)
# License: MIT

cmake_minimum_required(VERSION 2.8)

if (CMAKE_BUILD_TYPE_INITIALIZED_TO_DEFAULT)
set(CMAKE_BUILD_TYPE Release)
endif ()

project(cometa)

include_directories(include)

set(SRC
include/cometa.hpp
include/cident.h
include/cometa/string.hpp
)

add_compile_options(-std=c++1y -Wall)

add_executable(cometa_test tests/cometa_test.cpp ${SRC})
@@ -0,0 +1,31 @@
# CoMeta

[![Build Status](https://travis-ci.org/kfrlib/cometa.svg?branch=master)](https://travis-ci.org/kfrlib/cometa)

Lightweight, header-only C++14 metaprogramming library.
Created for [KFR framework](https://github.com/kfrlib/kfr).

## Features

* Pattern matching
* Compile-time arrays
* Compile-time type information (CTTI)
* Compile-time string manipulation
* Compile-time operations on arrays and numbers
* 'value-or-errorcode' union-like type
* type for passing named arguments
* function wrapper (lightweight replacement for std::function)
* Useful constexpr functions and many more.

## Platform

CoMeta is platform-independent but modern C++14 compiler is required.

* AppleClang (XCode 7, 8)
* Clang 3.7 or newer
* GCC 5.1 or newer

## License
MIT

See LICENSE for details
@@ -0,0 +1,26 @@
#!/usr/bin/env python
from __future__ import print_function

import fnmatch
import os
import subprocess
import sys
import glob

path = os.path.dirname(os.path.realpath(__file__))

filenames = []
for root, dirnames, files in os.walk(path, path):
for filename in fnmatch.filter(files, '*.hpp'):
filenames.append(os.path.join(root, filename))
for filename in fnmatch.filter(files, '*.h'):
filenames.append(os.path.join(root, filename))
for filename in fnmatch.filter(files, '*.cpp'):
filenames.append(os.path.join(root, filename))

for filename in filenames:
print( filename, '...' )
subprocess.call(['clang-format', '-i', filename])
# Fix clang-format bug: https://llvm.org/bugs/show_bug.cgi?id=26125
for tmp_file in glob.glob(filename+'*.tmp'):
os.remove(tmp_file)
Oops, something went wrong.

0 comments on commit fbbfb3c

Please sign in to comment.