File ScopedLocale.h

Copyright

This code is licensed under the 3-clause BSD license.

Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.

See LICENSE.txt for details.

namespace Scine

This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.

This header contains alias definitions defining which classes to use for the different degrees of derivatives.

namespace Utils
class ScopedLocale
#include <ScopedLocale.h>

Introduces a scope to change the locale, the original locale will be set back upon destruction.

Public Functions

ScopedLocale(const std::string &targetLocale)

Explicit constructor to avoid unintentional instances.

ScopedLocale(const ScopedLocale&)

Deleted copy constructor to avoid duplicate instances.

ScopedLocale(ScopedLocale&&)

Move constructor.

~ScopedLocale()

Custom Destructor.

ScopedLocale &operator=(const ScopedLocale&)
ScopedLocale &operator=(ScopedLocale&&)

Public Static Functions

static ScopedLocale cLocale()

Scope for the standard C locale.

Return

ScopedLocale

Private Members

std::string originalLocale_
bool mustBeSetBackInDestructor_ = true