mirror of
https://github.com/boostorg/exception.git
synced 2025-07-23 17:17:16 +02:00
Fixing compile error due to __LINE__ not always being compile-time constant on MSVC
[SVN r60159]
This commit is contained in:
@ -69,7 +69,7 @@ boost
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int Line>
|
template <int Dummy>
|
||||||
exception_ptr
|
exception_ptr
|
||||||
get_bad_alloc()
|
get_bad_alloc()
|
||||||
{
|
{
|
||||||
@ -77,21 +77,21 @@ boost
|
|||||||
bad_alloc_() <<
|
bad_alloc_() <<
|
||||||
throw_function("boost::current_exception()") <<
|
throw_function("boost::current_exception()") <<
|
||||||
throw_file(__FILE__) <<
|
throw_file(__FILE__) <<
|
||||||
throw_line(Line) );
|
throw_line(__LINE__) );
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <int Line>
|
template <int Dummy>
|
||||||
struct
|
struct
|
||||||
exception_ptr_bad_alloc
|
exception_ptr_bad_alloc
|
||||||
{
|
{
|
||||||
static exception_ptr const e;
|
static exception_ptr const e;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int Line>
|
template <int Dummy>
|
||||||
exception_ptr const
|
exception_ptr const
|
||||||
exception_ptr_bad_alloc<Line>::
|
exception_ptr_bad_alloc<Dummy>::
|
||||||
e = get_bad_alloc<Line>();
|
e = get_bad_alloc<Dummy>();
|
||||||
}
|
}
|
||||||
|
|
||||||
class
|
class
|
||||||
@ -354,7 +354,7 @@ boost
|
|||||||
catch(
|
catch(
|
||||||
std::bad_alloc & )
|
std::bad_alloc & )
|
||||||
{
|
{
|
||||||
ret=exception_detail::exception_ptr_bad_alloc<__LINE__>::e;
|
ret=exception_detail::exception_ptr_bad_alloc<42>::e;
|
||||||
}
|
}
|
||||||
catch(
|
catch(
|
||||||
... )
|
... )
|
||||||
@ -366,7 +366,7 @@ boost
|
|||||||
catch(
|
catch(
|
||||||
std::bad_alloc & )
|
std::bad_alloc & )
|
||||||
{
|
{
|
||||||
ret=exception_detail::exception_ptr_bad_alloc<__LINE__>::e;
|
ret=exception_detail::exception_ptr_bad_alloc<42>::e;
|
||||||
}
|
}
|
||||||
catch(
|
catch(
|
||||||
... )
|
... )
|
||||||
|
Reference in New Issue
Block a user