Skip to content

Cmajor 3.5.0 for Windows x64 and Linux

Compare
Choose a tag to compare
@slaakko slaakko released this 10 May 14:44
· 559 commits to master since this release

Cmajor 3.5.0 for Windows x64 and Linux

Release notes

  • The previous 3.4.0 version was broken.
    It printed an error message about missing SOULNG_ROOT environment variable.
    Sorry for the inconvenience for those who downloaded it and tried to use it.
    In this version this has been fixed.

  • Default TextWriter output operators for Pair<T, U> and for the following containers:
    List<T>, Set<T, C>, Map<Key, Value, KeyCompare>, HashSet<T, H, C> and HashMap<K, T, H, C>.
    The TextWriter output operator for Pair<T, U> is defined as follows:

    public TextWriter& operator<<<T, U>(TextWriter& writer, const Pair<T, U>& pair)
    {
        return writer << "(" << pair.first << ", " << pair.second << ")";
    }
    
    • The default output operator for Pair<T, U> prints the first and second members of the pair inside parentheses separated by a comma.
    • The default output operator for List<T> prints the elements of the list inside brackets "[" and "]" and separated by commas.
    • The default output operator for Set<T> prints the elements of the set inside braces "{" and "}" and separated by commas.
    • The default output operator for Map<Key, Value, KeyCompare> prints the elements (pairs) of the map inside braces "{" and "}" and separated by commas.
    • The default output operator for HashSet<T, H, C> prints the elements of the hashset inside braces "{" and "}" and separated by commas.
    • The default output operator for HashMap<K, T, H, C> prints the elements (pairs) of the hashmap inside braces "{" and "}" and separated by commas.

    If you want to define your own output operator for one of those container types, you can do so by deriving
    your own container type from that container type and define the output operator for that type.
    For example, deriving a class template from List<T> called MyList<T> and defining an output operator for it:

    public class MyList<T> : List<T>
    {
    }
    public TextWriter& operator<<<T>(TextWriter& writer, const MyList<T>& myList)
    {
        // print myList
        return writer;
    }