Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit fbbfb3c

Browse files
committed
Initial commit
1 parent c62a812 commit fbbfb3c

File tree

10 files changed

+3051
-0
lines changed

10 files changed

+3051
-0
lines changed

Diff for: .clang-format

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
UseTab: Never
2+
IndentWidth: 4
3+
Language : Cpp
4+
BreakBeforeBraces: Allman
5+
MaxEmptyLinesToKeep: 1
6+
IndentCaseLabels: false
7+
NamespaceIndentation: None
8+
AccessModifierOffset: -4
9+
SpacesInParentheses: false
10+
SpaceInEmptyParentheses: false
11+
SpacesInCStyleCastParentheses: false
12+
PointerAlignment: Left
13+
Cpp11BracedListStyle: false
14+
AllowShortIfStatementsOnASingleLine: false
15+
AllowShortFunctionsOnASingleLine : true
16+
AlignOperands: true
17+
Standard: Cpp11
18+
IndentCaseLabels: false
19+
AlignTrailingComments : false
20+
ConstructorInitializerAllOnOneLineOrOnePerLine : false
21+
ColumnLimit: 110
22+
BinPackParameters : true
23+
BinPackArguments : true
24+
AlwaysBreakTemplateDeclarations : true
25+
AlignConsecutiveAssignments : true
26+
PenaltyReturnTypeOnItsOwnLine: 50000
27+
CommentPragmas: '^ >>>'

Diff for: .gitignore

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Compiled Object files
2+
*.slo
3+
*.lo
4+
*.o
5+
*.obj
6+
7+
# Precompiled Headers
8+
*.gch
9+
*.pch
10+
11+
# Compiled Dynamic libraries
12+
*.so
13+
*.dylib
14+
*.dll
15+
16+
# Fortran module files
17+
*.mod
18+
*.smod
19+
20+
# Compiled Static libraries
21+
*.lai
22+
*.la
23+
*.a
24+
*.lib
25+
26+
# Executables
27+
*.exe
28+
*.out
29+
*.app
30+
31+
# CMake files
32+
CMakeCache.txt
33+
CMakeFiles
34+
CMakeScripts
35+
Makefile
36+
cmake_install.cmake
37+
install_manifest.txt
38+
CTestTestfile.cmake
39+
40+
# build directory
41+
build/
42+
43+
# test directory
44+
svg/
45+
46+
# Byte-compiled / optimized / DLL files
47+
__pycache__/
48+
*.py[cod]
49+
*$py.class
50+
51+
# Distribution / packaging
52+
.Python
53+
env/
54+
build/
55+
develop-eggs/
56+
dist/
57+
downloads/
58+
eggs/
59+
.eggs/
60+
lib/
61+
lib64/
62+
parts/
63+
sdist/
64+
var/
65+
*.egg-info/
66+
.installed.cfg
67+
*.egg
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# CLion
73+
.idea/

Diff for: .travis.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
sudo: required
2+
dist: trusty
3+
language: cpp
4+
5+
matrix:
6+
include:
7+
- compiler: gcc
8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- g++-5
14+
env: COMPILER=g++-5
15+
- compiler: clang
16+
addons:
17+
apt:
18+
sources:
19+
- ubuntu-toolchain-r-test
20+
- llvm-toolchain-precise-3.7
21+
packages:
22+
- g++-5
23+
- clang-3.7
24+
env: COMPILER=clang++-3.7
25+
- compiler: clang
26+
addons:
27+
apt:
28+
sources:
29+
- ubuntu-toolchain-r-test
30+
- llvm-toolchain-precise-3.8
31+
packages:
32+
- g++-5
33+
- clang-3.8
34+
env: COMPILER=clang++-3.8
35+
36+
before_install:
37+
- sudo apt-get update -qq
38+
script:
39+
- mkdir build
40+
- cd build
41+
- cmake -DCMAKE_CXX_COMPILER=$COMPILER -DCMAKE_BUILD_TYPE=Release .. && make

Diff for: CMakeLists.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2016 D Levin (http://www.kfrlib.com)
2+
# This file is part of CoMeta (C++14 metaprogramming library created for KFR framework)
3+
# License: MIT
4+
5+
cmake_minimum_required(VERSION 2.8)
6+
7+
if (CMAKE_BUILD_TYPE_INITIALIZED_TO_DEFAULT)
8+
set(CMAKE_BUILD_TYPE Release)
9+
endif ()
10+
11+
project(cometa)
12+
13+
include_directories(include)
14+
15+
set(SRC
16+
include/cometa.hpp
17+
include/cident.h
18+
include/cometa/string.hpp
19+
)
20+
21+
add_compile_options(-std=c++1y -Wall)
22+
23+
add_executable(cometa_test tests/cometa_test.cpp ${SRC})

Diff for: README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# CoMeta
2+
3+
[![Build Status](https://travis-ci.org/kfrlib/cometa.svg?branch=master)](https://travis-ci.org/kfrlib/cometa)
4+
5+
Lightweight, header-only C++14 metaprogramming library.
6+
Created for [KFR framework](https://github.com/kfrlib/kfr).
7+
8+
## Features
9+
10+
* Pattern matching
11+
* Compile-time arrays
12+
* Compile-time type information (CTTI)
13+
* Compile-time string manipulation
14+
* Compile-time operations on arrays and numbers
15+
* 'value-or-errorcode' union-like type
16+
* type for passing named arguments
17+
* function wrapper (lightweight replacement for std::function)
18+
* Useful constexpr functions and many more.
19+
20+
## Platform
21+
22+
CoMeta is platform-independent but modern C++14 compiler is required.
23+
24+
* AppleClang (XCode 7, 8)
25+
* Clang 3.7 or newer
26+
* GCC 5.1 or newer
27+
28+
## License
29+
MIT
30+
31+
See LICENSE for details

Diff for: format-all.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
from __future__ import print_function
3+
4+
import fnmatch
5+
import os
6+
import subprocess
7+
import sys
8+
import glob
9+
10+
path = os.path.dirname(os.path.realpath(__file__))
11+
12+
filenames = []
13+
for root, dirnames, files in os.walk(path, path):
14+
for filename in fnmatch.filter(files, '*.hpp'):
15+
filenames.append(os.path.join(root, filename))
16+
for filename in fnmatch.filter(files, '*.h'):
17+
filenames.append(os.path.join(root, filename))
18+
for filename in fnmatch.filter(files, '*.cpp'):
19+
filenames.append(os.path.join(root, filename))
20+
21+
for filename in filenames:
22+
print( filename, '...' )
23+
subprocess.call(['clang-format', '-i', filename])
24+
# Fix clang-format bug: https://llvm.org/bugs/show_bug.cgi?id=26125
25+
for tmp_file in glob.glob(filename+'*.tmp'):
26+
os.remove(tmp_file)

0 commit comments

Comments
 (0)