Unstandard
Unstandard is a library with useful general stuff not included in Phobos for various reasons.

Brief Unstandard content description

ExtractTypes trait

Members:

unstd.traits.ExtractTypes

Pulls:

no.

Description:

Useful for serialization algorithms which need to know all composing types.



ArrayElementType trait

Members:

unstd.traits.ArrayElementType

Pulls:

Phobos pull 776, closed by Andrei Alexandrescu

Description:

A convenient template to retrieve array element type for template programming purposes. Phobos's std.range.ElementEncodingType should be used only if array is treated as a range, otherwise it reduces templated code readability and looks inconsistent because many templates are from "differen world" and don't have to know anything about ranges.



Multidimensional static array traits

Members:

unstd.traits.staticArrayDims
unstd.traits.MultidimStaticArrayElementType
unstd.traits.multidimStaticArrayElementCount
unstd.traits.multidimStaticArrayLengths

Pulls:

Partially (except multidimStaticArrayLengths) in Phobos pull 924 (open).

Description:

These templates are needed for analysing multidimensional static arrays.



Function converting everything into a static array

Members:

unstd.array.asFlatStaticArray

Pulls:

Phobos pull 952 (open)

Description:

asFlatStaticArray adds an ability to view any abject as a single-dimensional static array which is very useful for template code as it eliminates error-prone need to create branches and recursion for static-arrays support.



Sliceable multidimensional array

Members:

unstd.multidimarray.MultidimArray
unstd.multidimarray.multidimArray

Pulls:

no.

Description:

unstd.multidimarray module adds ability to slice multidimensional rectangular arrays and ranges to iterate slices.



Generic tuple general templates

Members:

unstd.generictuple.GenericTuple
unstd.generictuple.TypeTuple
unstd.generictuple.expressionTuple

Pulls:

Phobos pull 780 (open).

Description:

There should be at least both GenericTuple and TypeTuple as the latter is a common usecase of generic tuples. E.g. TypeTuple is used ~70% of generic tuple usage in Phobos.



Packed generic tuple templates

Members:

unstd.generictuple.PackedGenericTuple
unstd.generictuple.PackedTypeTuple
unstd.generictuple.packedExpressionTuple
unstd.traits.isPackedTuple

Pulls:

no.

Description:

Useful when passing more than one generic tuple to a template.



Generic tuple creation templates

Members:

unstd.generictuple.RetroTuple
unstd.generictuple.StrideTuple
unstd.generictuple.ChainTuple
unstd.generictuple.RoundRobinTuple
unstd.generictuple.RadialTuple
unstd.generictuple.RepeatTuple
unstd.generictuple.ZipTuple
unstd.generictuple.iotaTuple
unstd.generictuple.IndexedTuple
unstd.generictuple.ChunksTuple

Pulls:

no.

Description:

Templates for generic tuple creation by analogy with range creation functions from std.range.



Generic tuple algorithm templates

Members:

unstd.generictuple.cmpTuple
unstd.generictuple.equalTuple
unstd.generictuple.FilterTuple
unstd.generictuple.groupTuple
unstd.generictuple.JoinTuple
unstd.generictuple.MapTuple
unstd.generictuple.ReduceTuple
unstd.generictuple.UniqTuple

Pulls:

no.

Description:

Templates for various algorithms on generic tuples by analogy with range algorithm functions from std.algorithm.



Template creating a set of flags

Members:

unstd.typecons.flagEnum

Pulls:

no.

Description:

Creates a set of flags for which any non-flag operations ar prohibited.



Commonly needed in programming integer mathematical functions related to powers of 2

Members:

unstd.math.isPowerOf2
unstd.math.roundDownToPowerOf2
unstd.math.roundUpToPowerOf2
unstd.math.log2RoundedDown
unstd.math.log2RoundedUp
unstd.math.alignDown
unstd.math.alignUp

Pulls:

no.

Description:

It is just too commonly needed to not include it in a standard library forsing almost everybody to spend time writing such functions.



Instantiate template

Members:

unstd.templates.Inst

Pulls:

no.

Description:

A convenience util to instantiate templates needed because of D syntax issues.



Create template from string

Members:

unstd.templates.Template
unstd.templates.UnaryTemplate
unstd.templates.BinaryTemplate
unstd.templates.unaryPred
unstd.templates.binaryPred

Pulls:

no.

Description:

A stuff for creating templates from strings.



Bind template arguments

Members:

unstd.templates.BindTemplate
unstd.templates.Bind

Pulls:

no.

Description:

A stuff for binding templates arguments.



Combine template predicates

Members:

unstd.templates.notTemplate
unstd.templates.andTemplates
unstd.templates.orTemplates

Pulls:

no.

Description:

A stuff for combining template predicates.



Function finalizing class instance referenced by its argument

Members:

unstd.lifetime.finalizeClassInstance

Pulls:

Druntime pull 344, closed by Andrei Alexandrescu

Description:

finalizeClassInstance accepts anly a class or an interface as against tricky (IMO needless, error-prone, and inconsistent) Druntime's destroy.



TypeInfo functions analogs

Members:

unstd.lifetime.setToInitialState
unstd.lifetime.setElementsToInitialState
unstd.lifetime.callPostblits
unstd.lifetime.callDestructors

Pulls:

Phobos pull 928 (open)

Description:

Use these functions instead of dealing with tricky typeid(T).



Add destruct function

Members:

unstd.lifetime.destruct

Pulls:

Phobos pull 929, closed by Andrei Alexandrescu

Description:

A function for object destruction which do exactly the same a compiler do in a case an object goes out of scope.



Function for binary memory copying

Members:

unstd.array.rawCopy

Pulls:

no.

Description:

This function is fast and CTFE-able and is a preffered way over C's memcpy and memmove.



Add move and dependent forward functions

Members:

unstd.lifetime.move
unstd.lifetime.forward

Pulls:

Phobos pull 923 (open)

Description:

Added move is a fixed and improved analog of std.algorithm.move. Added forward is just a copy of std.algorithm.forward implementation except it uses fixed move.



Add object construction functions

Members:

unstd.lifetime.constructFrom
unstd.lifetime.constructFromLiteral

Pulls:

Ideas of these functions are used in std.conv.emplace fix from Phobos pull 949 (open).

Description:

A functions for object construction which do exactly the same a compiler do initializing an object like T t = arg; or auto s = S(args); if S is a struct type.



Add class instance initialization function

Members:

unstd.lifetime.initializeClassInstance

Pulls:

no.

Description:

A functions for class instance initialization which do exactly the same a compiler do initializing an object like auto c = new C(args); if C is a class type except given memory is used instead of allocating.